Michael Chan afdc08b9f9 [BNX2]: Fix rtnl deadlock in bnx2_close
This fixes an rtnl deadlock problem when flush_scheduled_work() is
called from bnx2_close(). In rare cases, linkwatch_event() may be on
the workqueue from a previous close of a different device and it will
try to get the rtnl lock which is already held by dev_close().

The fix is to set a flag if we are in the reset task which is run
from the workqueue. bnx2_close() will loop until the flag is cleared.
As suggested by Jeff Garzik, the loop is changed to call msleep(1)
instead of yield() in the original patch.

flush_scheduled_work() is also moved to bnx2_remove_one() before the
netdev is freed.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-08-29 16:10:29 -07:00
..
2005-08-29 15:32:25 -07:00
2005-07-30 09:47:53 -05:00
2005-08-26 19:37:12 -07:00
2005-08-29 15:31:14 -07:00
2005-08-10 11:03:02 -07:00
2005-08-29 10:42:39 -07:00
2005-07-12 16:01:02 -07:00
2005-04-16 15:20:36 -07:00
2005-08-29 15:59:42 -04:00
2005-06-21 18:46:32 -07:00
2005-04-16 15:20:36 -07:00
2005-08-29 15:31:14 -07:00