aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2013-02-25 01:09:24 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-25 15:47:41 -0500
commit63a02ce1c5c59baa40b99756492e3ec8d6b51483 (patch)
tree2fe50a19d82bb27b536d34a0aee5bad7b8fcf686 /drivers/net
parent7992ae6df9733677fcc2e63c40b97854c605c399 (diff)
b43: Fix lockdep splat on module unload
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+ #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 <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> [V3.5+] Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/b43/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 806e34c19281..05682736e466 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4214,7 +4214,6 @@ redo:
4214 mutex_unlock(&wl->mutex); 4214 mutex_unlock(&wl->mutex);
4215 cancel_delayed_work_sync(&dev->periodic_work); 4215 cancel_delayed_work_sync(&dev->periodic_work);
4216 cancel_work_sync(&wl->tx_work); 4216 cancel_work_sync(&wl->tx_work);
4217 cancel_work_sync(&wl->firmware_load);
4218 mutex_lock(&wl->mutex); 4217 mutex_lock(&wl->mutex);
4219 dev = wl->current_dev; 4218 dev = wl->current_dev;
4220 if (!dev || b43_status(dev) < B43_STAT_STARTED) { 4219 if (!dev || b43_status(dev) < B43_STAT_STARTED) {
@@ -5434,6 +5433,7 @@ static void b43_bcma_remove(struct bcma_device *core)
5434 /* We must cancel any work here before unregistering from ieee80211, 5433 /* We must cancel any work here before unregistering from ieee80211,
5435 * as the ieee80211 unreg will destroy the workqueue. */ 5434 * as the ieee80211 unreg will destroy the workqueue. */
5436 cancel_work_sync(&wldev->restart_work); 5435 cancel_work_sync(&wldev->restart_work);
5436 cancel_work_sync(&wl->firmware_load);
5437 5437
5438 B43_WARN_ON(!wl); 5438 B43_WARN_ON(!wl);
5439 if (!wldev->fw.ucode.data) 5439 if (!wldev->fw.ucode.data)
@@ -5510,6 +5510,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
5510 /* We must cancel any work here before unregistering from ieee80211, 5510 /* We must cancel any work here before unregistering from ieee80211,
5511 * as the ieee80211 unreg will destroy the workqueue. */ 5511 * as the ieee80211 unreg will destroy the workqueue. */
5512 cancel_work_sync(&wldev->restart_work); 5512 cancel_work_sync(&wldev->restart_work);
5513 cancel_work_sync(&wl->firmware_load);
5513 5514
5514 B43_WARN_ON(!wl); 5515 B43_WARN_ON(!wl);
5515 if (!wldev->fw.ucode.data) 5516 if (!wldev->fw.ucode.data)