Commit 93ae6534 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

cnic: Fix rtnl deadlock

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: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 782d640a
...@@ -3983,9 +3983,7 @@ static void cnic_delete_task(struct work_struct *work) ...@@ -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)) { if (test_and_clear_bit(CNIC_LCL_FL_STOP_ISCSI, &cp->cnic_local_flags)) {
struct drv_ctl_info info; struct drv_ctl_info info;
rtnl_lock();
cnic_ulp_stop_one(cp, CNIC_ULP_ISCSI); cnic_ulp_stop_one(cp, CNIC_ULP_ISCSI);
rtnl_unlock();
info.cmd = DRV_CTL_ISCSI_STOPPED_CMD; info.cmd = DRV_CTL_ISCSI_STOPPED_CMD;
cp->ethdev->drv_ctl(dev->netdev, &info); cp->ethdev->drv_ctl(dev->netdev, &info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment