cnic: Fix rtnl deadlock
authorMichael Chan <mchan@broadcom.com>
Fri, 8 Apr 2011 20:03:02 +0000 (13:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Apr 2011 20:03:02 +0000 (13:03 -0700)
commit93ae653491f0a413d5f4d9aa4df45d09ecb55d62
tree0540b85362f08bd551bcd9f7840a061a71996fa9
parent782d640afd15af7a1faf01cfe566ca4ac511319d
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: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/cnic.c