From: Ron Mercer <ron.mercer@qlogic.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, ron.mercer@qlogic.com
Subject: [net-2.6 PATCH 4/5] qlge: Protect reset recovery with rtnl_lock().
Date: Tue, 29 Sep 2009 11:39:24 -0700 [thread overview]
Message-ID: <1254249565-16381-5-git-send-email-ron.mercer@qlogic.com> (raw)
In-Reply-To: <1254249565-16381-1-git-send-email-ron.mercer@qlogic.com>
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(-)
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();
--
1.6.0.2
next prev parent reply other threads:[~2009-09-29 18:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-29 18:39 [net-2.6 PATCH 0/5] qlge: Bug fixes for qlge Ron Mercer
2009-09-29 18:39 ` [net-2.6 PATCH 1/5] qlge: Fix bad bit definitions Ron Mercer
2009-09-29 18:39 ` [net-2.6 PATCH 2/5] qlge: Fix out of sync hardware semaphore Ron Mercer
2009-09-29 18:39 ` [net-2.6 PATCH 3/5] qlge: Fix spin_lock warning Ron Mercer
2009-09-29 18:39 ` Ron Mercer [this message]
2009-09-29 18:39 ` [net-2.6 PATCH 5/5] qlge: Fix error exit for probe call Ron Mercer
2009-10-01 3:04 ` [net-2.6 PATCH 0/5] qlge: Bug fixes for qlge David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1254249565-16381-5-git-send-email-ron.mercer@qlogic.com \
--to=ron.mercer@qlogic.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).