Patchwork [net-2.6,4/5] qlge: Protect reset recovery with rtnl_lock().

login
register
mail settings
Submitter Ron Mercer
Date Sept. 29, 2009, 6:39 p.m.
Message ID <1254249565-16381-5-git-send-email-ron.mercer@qlogic.com>
Download mbox | patch
Permalink /patch/34449/
State Accepted
Delegated to: David Miller
Headers show

Comments

Ron Mercer - Sept. 29, 2009, 6:39 p.m.
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>
---
 drivers/net/qlge/qlge_main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index b05300d..fbef305 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();