Skip to content

Commit 66c45d4

Browse files
lwfingergregkh
authored andcommitted
b43: Fix lockdep splat on module unload
commit 63a02ce upstream. On unload, b43 produces a lockdep warning that can be summarized in the following way: ====================================================== [ INFO: possible circular locking dependency detected ] 3.8.0-wl+ raspberrypi#117 Not tainted ------------------------------------------------------- modprobe/5557 is trying to acquire lock: ((&wl->firmware_load)){+.+.+.}, at: [<ffffffff81062160>] flush_work+0x0/0x2a0 but task is already holding lock: (rtnl_mutex){+.+.+.}, at: [<ffffffff813bd7d2>] rtnl_lock+0x12/0x20 which lock already depends on the new lock. [ INFO: possible circular locking dependency detected ] ====================================================== The full output is available at http://lkml.indiana.edu/hypermail/linux/kernel/1302.3/00060.html. To summarize, commit 6b6fa58 added a 'cancel_work_sync(&wl->firmware_load)' call in the wrong place. The fix is to move the cancel_work_sync() call to b43_bcma_remove() and b43_ssb_remove(). Thanks to Johannes Berg and Michael Buesch for help in diagnosing the log output. Signed-off-by: Larry Finger <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e3d7ed9 commit 66c45d4

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/wireless/b43

1 file changed

+2
-1
lines changed

drivers/net/wireless/b43/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4214,7 +4214,6 @@ static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev)
42144214
mutex_unlock(&wl->mutex);
42154215
cancel_delayed_work_sync(&dev->periodic_work);
42164216
cancel_work_sync(&wl->tx_work);
4217-
cancel_work_sync(&wl->firmware_load);
42184217
mutex_lock(&wl->mutex);
42194218
dev = wl->current_dev;
42204219
if (!dev || b43_status(dev) < B43_STAT_STARTED) {
@@ -5434,6 +5433,7 @@ static void b43_bcma_remove(struct bcma_device *core)
54345433
/* We must cancel any work here before unregistering from ieee80211,
54355434
* as the ieee80211 unreg will destroy the workqueue. */
54365435
cancel_work_sync(&wldev->restart_work);
5436+
cancel_work_sync(&wl->firmware_load);
54375437

54385438
B43_WARN_ON(!wl);
54395439
if (!wldev->fw.ucode.data)
@@ -5510,6 +5510,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
55105510
/* We must cancel any work here before unregistering from ieee80211,
55115511
* as the ieee80211 unreg will destroy the workqueue. */
55125512
cancel_work_sync(&wldev->restart_work);
5513+
cancel_work_sync(&wl->firmware_load);
55135514

55145515
B43_WARN_ON(!wl);
55155516
if (!wldev->fw.ucode.data)

0 commit comments

Comments
 (0)