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>
struct wl12xx_vif *wlvif;
unsigned long flags;
bool run_irq_work = false, pending_recovery;
struct wl12xx_vif *wlvif;
unsigned long flags;
bool run_irq_work = false, pending_recovery;
wl1271_debug(DEBUG_MAC80211, "mac80211 resume wow=%d",
wl->wow_enabled);
wl1271_debug(DEBUG_MAC80211, "mac80211 resume wow=%d",
wl->wow_enabled);
run_irq_work = true;
spin_unlock_irqrestore(&wl->wl_lock, flags);
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);
/* test the recovery flag before calling any SDIO functions */
pending_recovery = test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS,
&wl->flags);
"run postponed irq_work directly");
/* don't talk to the HW if recovery is pending */
"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);
}
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);
if (pending_recovery) {
wl1271_warning("queuing forgotten recovery on resume");
ieee80211_queue_work(wl->hw, &wl->recovery_work);