diff options
author | Sathya Perla <sathya.perla@emulex.com> | 2011-05-12 21:32:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-13 20:41:34 +0200 |
commit | 6ed35eea3b96977d76d61b5862a3209044cb4b1f (patch) | |
tree | adec1550204379d90bd35a1aedf681d488b4267e /drivers/net/benet | |
parent | ethtool: Added support for FW dump (diff) | |
download | linux-6ed35eea3b96977d76d61b5862a3209044cb4b1f.tar.xz linux-6ed35eea3b96977d76d61b5862a3209044cb4b1f.zip |
be2net: handle signal reception while waiting for POST
If waiting on POST returns prematurely (due to a signal), abort polling and return an error.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r-- | drivers/net/benet/be_cmds.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 0dbb4cbc07b6..d558b9088d7e 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c @@ -376,23 +376,25 @@ int be_cmd_POST(struct be_adapter *adapter) { u16 stage; int status, timeout = 0; + struct device *dev = &adapter->pdev->dev; do { status = be_POST_stage_get(adapter, &stage); if (status) { - dev_err(&adapter->pdev->dev, "POST error; stage=0x%x\n", - stage); + dev_err(dev, "POST error; stage=0x%x\n", stage); return -1; } else if (stage != POST_STAGE_ARMFW_RDY) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(2 * HZ); + if (msleep_interruptible(2000)) { + dev_err(dev, "Waiting for POST aborted\n"); + return -EINTR; + } timeout += 2; } else { return 0; } } while (timeout < 40); - dev_err(&adapter->pdev->dev, "POST timeout; stage=0x%x\n", stage); + dev_err(dev, "POST timeout; stage=0x%x\n", stage); return -1; } |