aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-06-21 18:10:52 +0300
committerLuciano Coelho <coelho@ti.com>2012-06-23 09:32:33 +0300
commit725b82775e7901dc92afaddfa45683934e75c33e (patch)
tree183dd3e6357b63df0e0a1d804d66e4f2299615b9 /drivers/net/wireless
parentwlcore: refactor threaded IRQ routine (diff)
downloadlinux-dev-725b82775e7901dc92afaddfa45683934e75c33e.tar.xz
linux-dev-725b82775e7901dc92afaddfa45683934e75c33e.zip
wlcore: prevent recovery in the middle of resume
Take the mutex early in the resume handler and use the locked version of the IRQ routine. This ensures any recoveries queued will only take place after resume has fully completed. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 0c1e0751ecaa..372ccf277b1e 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1723,6 +1723,7 @@ static int wl1271_op_resume(struct ieee80211_hw *hw)
struct wl12xx_vif *wlvif;
unsigned long flags;
bool run_irq_work = false, pending_recovery;
+ int ret;
wl1271_debug(DEBUG_MAC80211, "mac80211 resume wow=%d",
wl->wow_enabled);
@@ -1738,6 +1739,8 @@ static int wl1271_op_resume(struct ieee80211_hw *hw)
run_irq_work = true;
spin_unlock_irqrestore(&wl->wl_lock, flags);
+ mutex_lock(&wl->mutex);
+
/* test the recovery flag before calling any SDIO functions */
pending_recovery = test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS,
&wl->flags);
@@ -1747,13 +1750,15 @@ static int wl1271_op_resume(struct ieee80211_hw *hw)
"run postponed irq_work directly");
/* don't talk to the HW if recovery is pending */
- if (!pending_recovery)
- wlcore_irq(0, wl);
+ if (!pending_recovery) {
+ ret = wlcore_irq_locked(wl);
+ if (ret)
+ wl12xx_queue_recovery_work(wl);
+ }
wlcore_enable_interrupts(wl);
}
- mutex_lock(&wl->mutex);
if (pending_recovery) {
wl1271_warning("queuing forgotten recovery on resume");
ieee80211_queue_work(wl->hw, &wl->recovery_work);