summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-09-29 10:39:24 +0200
committerDavid S. Miller <davem@davemloft.net>2009-10-01 05:03:11 +0200
commitf2c0d8df05228b64dbb2d8d4b6e2089c98041ada (patch)
tree5a21c44e41d80c43795770ea11bd13afccfc6b17
parentqlge: Fix spin_lock warning. (diff)
downloadlinux-f2c0d8df05228b64dbb2d8d4b6e2089c98041ada.tar.xz
linux-f2c0d8df05228b64dbb2d8d4b6e2089c98041ada.zip
qlge: Protect reset recovery with rtnl_lock().
Move the call to rtnl_lock() to before the internal call to ql_adapter_down()/ql_adapter_up(). This prevents collisions that can happen when recovering from an asic error. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/qlge/qlge_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 92976c6b40f5..c30350c8c86a 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -3703,7 +3703,7 @@ static void ql_asic_reset_work(struct work_struct *work)
struct ql_adapter *qdev =
container_of(work, struct ql_adapter, asic_reset_work.work);
int status;
-
+ rtnl_lock();
status = ql_adapter_down(qdev);
if (status)
goto error;
@@ -3711,12 +3711,12 @@ static void ql_asic_reset_work(struct work_struct *work)
status = ql_adapter_up(qdev);
if (status)
goto error;
-
+ rtnl_unlock();
return;
error:
QPRINTK(qdev, IFUP, ALERT,
"Driver up/down cycle failed, closing device\n");
- rtnl_lock();
+
set_bit(QL_ADAPTER_UP, &qdev->flags);
dev_close(qdev->ndev);
rtnl_unlock();