diff options
author | Vasanthy Kolluri <vkolluri@cisco.com> | 2010-06-24 10:52:08 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-25 20:50:25 -0700 |
commit | 506e1198413d28446f9a98792b2b38b6bf5f8295 (patch) | |
tree | e86d4441f76ae2424128261a6df65a0256257dc6 /drivers/net/enic/vnic_dev.c | |
parent | 1825aca667196f75b193e2d509ea96ffdc8db0ca (diff) |
enic: Bug Fix: Handle surprise hardware removals
Handle surprise hardware removals gracefully during devcmd issue and init,
cleanup of queues.
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic/vnic_dev.c')
-rw-r--r-- | drivers/net/enic/vnic_dev.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c index 180912f48007..662123c9581e 100644 --- a/drivers/net/enic/vnic_dev.c +++ b/drivers/net/enic/vnic_dev.c @@ -275,6 +275,11 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, int err; status = ioread32(&devcmd->status); + if (status == 0xFFFFFFFF) { + /* PCI-e target device is gone */ + return -ENODEV; + } + if (status & STAT_BUSY) { pr_err("Busy devcmd %d\n", _CMD_N(cmd)); return -EBUSY; @@ -296,6 +301,10 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, udelay(100); status = ioread32(&devcmd->status); + if (status == 0xFFFFFFFF) { + /* PCI-e target device is gone */ + return -ENODEV; + } if (!(status & STAT_BUSY)) { |