* [PATCH net-next] cnic: Fix rtnl deadlock
@ 2011-04-08 17:44 Michael Chan
2011-04-08 20:03 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Michael Chan @ 2011-04-08 17:44 UTC (permalink / raw)
To: davem; +Cc: netdev
When cnic_stop_hw() -> cnic_cm_stop_bnx2x_hw() is called under rtnl_lock()
from NETDEV_DOWN event, it waits for cnic_delete_task() to complete.
It will deadlock when cnic_delete_task() takes rtnl_lock() before
calling cnic_ulp_stop_one().
We fix it by removing the rtnl_lock() in cnic_delete_task().
cnic_ulp_stop_one() has mutex and atomic bit ops to prevent important
operations from being done more than once, so it is not necessary to take
rtnl_lock().
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 5dfbff0..cde59b4 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -3983,9 +3983,7 @@ static void cnic_delete_task(struct work_struct *work)
if (test_and_clear_bit(CNIC_LCL_FL_STOP_ISCSI, &cp->cnic_local_flags)) {
struct drv_ctl_info info;
- rtnl_lock();
cnic_ulp_stop_one(cp, CNIC_ULP_ISCSI);
- rtnl_unlock();
info.cmd = DRV_CTL_ISCSI_STOPPED_CMD;
cp->ethdev->drv_ctl(dev->netdev, &info);
--
1.6.4.GIT
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] cnic: Fix rtnl deadlock
2011-04-08 17:44 [PATCH net-next] cnic: Fix rtnl deadlock Michael Chan
@ 2011-04-08 20:03 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-04-08 20:03 UTC (permalink / raw)
To: mchan; +Cc: netdev
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 8 Apr 2011 10:44:14 -0700
> When cnic_stop_hw() -> cnic_cm_stop_bnx2x_hw() is called under rtnl_lock()
> from NETDEV_DOWN event, it waits for cnic_delete_task() to complete.
> It will deadlock when cnic_delete_task() takes rtnl_lock() before
> calling cnic_ulp_stop_one().
>
> We fix it by removing the rtnl_lock() in cnic_delete_task().
> cnic_ulp_stop_one() has mutex and atomic bit ops to prevent important
> operations from being done more than once, so it is not necessary to take
> rtnl_lock().
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied, thanks Michael.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-08 20:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-08 17:44 [PATCH net-next] cnic: Fix rtnl deadlock Michael Chan
2011-04-08 20:03 ` David Miller
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).