diff options
author | Ido Yariv <ido@wizery.com> | 2012-08-15 08:09:30 -0400 |
---|---|---|
committer | Luciano Coelho <luca@coelho.fi> | 2012-09-27 05:13:53 -0400 |
commit | 792a58a8720f02c8f340583f6ee54c9eb46adf0b (patch) | |
tree | 1cab60d86534dab47c9f0083e19c37dfae1d4ae1 /drivers/net/wireless | |
parent | 1defbeb0426b5ca6280369b8fa89f0170420ff40 (diff) |
wlcore: Don't recover during boot
While recursive recovery is avoided during shutdown, a new recovery may
be queued when the FW boots. The recovery work will then try to stop an
already stopped hardware, which will most likely result in a kernel
panic.
Fix this by verifying that wl->state is on before queueing a new
recovery.
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ti/wlcore/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 7b825e8c1a9b..3f5d87e95d92 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c | |||
@@ -775,8 +775,9 @@ void wl12xx_queue_recovery_work(struct wl1271 *wl) | |||
775 | WARN_ON(!test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags)); | 775 | WARN_ON(!test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags)); |
776 | 776 | ||
777 | /* Avoid a recursive recovery */ | 777 | /* Avoid a recursive recovery */ |
778 | if (!test_and_set_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags)) { | 778 | if (wl->state == WLCORE_STATE_ON) { |
779 | wl->state = WLCORE_STATE_RESTARTING; | 779 | wl->state = WLCORE_STATE_RESTARTING; |
780 | set_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags); | ||
780 | wlcore_disable_interrupts_nosync(wl); | 781 | wlcore_disable_interrupts_nosync(wl); |
781 | ieee80211_queue_work(wl->hw, &wl->recovery_work); | 782 | ieee80211_queue_work(wl->hw, &wl->recovery_work); |
782 | } | 783 | } |