diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2014-01-12 16:11:37 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-01-13 14:50:02 -0500 |
commit | 09164043f63c947a49797750a09ca1cd7c31108e (patch) | |
tree | 5c21741cd96bb16df0c54c063b010c324b94248c /drivers/net/wireless | |
parent | 9795229752c31da0c5f8a7dc4c827665327b52f9 (diff) |
b43: Fix lockdep splat
In https://bugzilla.kernel.org/show_bug.cgi?id=67561, a locking dependency is reported
when b43 is used with hostapd, and rfkill is used to kill the radio output.
The lockdep splat (in part) is as follows:
======================================================
[ INFO: possible circular locking dependency detected ]
3.12.0 #1 Not tainted
-------------------------------------------------------
rfkill/10040 is trying to acquire lock:
(rtnl_mutex){+.+.+.}, at: [<ffffffff8146f282>] rtnl_lock+0x12/0x20
but task is already holding lock:
(rfkill_global_mutex){+.+.+.}, at: [<ffffffffa04832ca>] rfkill_fop_write+0x6a/0x170 [rfkill]
--snip--
Chain exists of:
rtnl_mutex --> misc_mtx --> rfkill_global_mutex
The fix is to move the initialization of the hardware random number generator
outside the code range covered by the rtnl_mutex.
Reported-by: yury <urykhy@gmail.com>
Tested-by: yury <urykhy@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index ccd24f0acb8d..86b2030055d2 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -2424,6 +2424,7 @@ error: | |||
2424 | 2424 | ||
2425 | static int b43_one_core_attach(struct b43_bus_dev *dev, struct b43_wl *wl); | 2425 | static int b43_one_core_attach(struct b43_bus_dev *dev, struct b43_wl *wl); |
2426 | static void b43_one_core_detach(struct b43_bus_dev *dev); | 2426 | static void b43_one_core_detach(struct b43_bus_dev *dev); |
2427 | static int b43_rng_init(struct b43_wl *wl); | ||
2427 | 2428 | ||
2428 | static void b43_request_firmware(struct work_struct *work) | 2429 | static void b43_request_firmware(struct work_struct *work) |
2429 | { | 2430 | { |
@@ -2475,6 +2476,10 @@ start_ieee80211: | |||
2475 | goto err_one_core_detach; | 2476 | goto err_one_core_detach; |
2476 | wl->hw_registred = true; | 2477 | wl->hw_registred = true; |
2477 | b43_leds_register(wl->current_dev); | 2478 | b43_leds_register(wl->current_dev); |
2479 | |||
2480 | /* Register HW RNG driver */ | ||
2481 | b43_rng_init(wl); | ||
2482 | |||
2478 | goto out; | 2483 | goto out; |
2479 | 2484 | ||
2480 | err_one_core_detach: | 2485 | err_one_core_detach: |
@@ -4636,9 +4641,6 @@ static void b43_wireless_core_exit(struct b43_wldev *dev) | |||
4636 | if (!dev || b43_status(dev) != B43_STAT_INITIALIZED) | 4641 | if (!dev || b43_status(dev) != B43_STAT_INITIALIZED) |
4637 | return; | 4642 | return; |
4638 | 4643 | ||
4639 | /* Unregister HW RNG driver */ | ||
4640 | b43_rng_exit(dev->wl); | ||
4641 | |||
4642 | b43_set_status(dev, B43_STAT_UNINIT); | 4644 | b43_set_status(dev, B43_STAT_UNINIT); |
4643 | 4645 | ||
4644 | /* Stop the microcode PSM. */ | 4646 | /* Stop the microcode PSM. */ |
@@ -4795,9 +4797,6 @@ static int b43_wireless_core_init(struct b43_wldev *dev) | |||
4795 | 4797 | ||
4796 | b43_set_status(dev, B43_STAT_INITIALIZED); | 4798 | b43_set_status(dev, B43_STAT_INITIALIZED); |
4797 | 4799 | ||
4798 | /* Register HW RNG driver */ | ||
4799 | b43_rng_init(dev->wl); | ||
4800 | |||
4801 | out: | 4800 | out: |
4802 | return err; | 4801 | return err; |
4803 | 4802 | ||
@@ -5464,6 +5463,9 @@ static void b43_bcma_remove(struct bcma_device *core) | |||
5464 | 5463 | ||
5465 | b43_one_core_detach(wldev->dev); | 5464 | b43_one_core_detach(wldev->dev); |
5466 | 5465 | ||
5466 | /* Unregister HW RNG driver */ | ||
5467 | b43_rng_exit(wl); | ||
5468 | |||
5467 | b43_leds_unregister(wl); | 5469 | b43_leds_unregister(wl); |
5468 | 5470 | ||
5469 | ieee80211_free_hw(wl->hw); | 5471 | ieee80211_free_hw(wl->hw); |
@@ -5541,6 +5543,9 @@ static void b43_ssb_remove(struct ssb_device *sdev) | |||
5541 | 5543 | ||
5542 | b43_one_core_detach(dev); | 5544 | b43_one_core_detach(dev); |
5543 | 5545 | ||
5546 | /* Unregister HW RNG driver */ | ||
5547 | b43_rng_exit(wl); | ||
5548 | |||
5544 | if (list_empty(&wl->devlist)) { | 5549 | if (list_empty(&wl->devlist)) { |
5545 | b43_leds_unregister(wl); | 5550 | b43_leds_unregister(wl); |
5546 | /* Last core on the chip unregistered. | 5551 | /* Last core on the chip unregistered. |