[PATCH] Avoid deadlock in smc91x driver
This patch avoids a deadlock on rtnl_sem in smc_close() when bringing down an smc91x interface. The semaphore is already held by devinet_ioctl() and the pending work queue contains linkwatch_event() (scheduled by netif_carrier_off()) which also wants rtnl_sem hence it is unsafe to call flush_scheduled_work(). The solution is to track whether we have any pending work of our own and wait for that instead of flushing the entire queue. I also fixed a typo 'ence' -> 'Hence' and renamed smc_detect_phy to smc_phy_detect in order to follow the same pattern as the other smc_phy_* functions. Signed-off-by: Ian Campbell <icampbell@arcom.com> Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing
Please register or sign in to comment