ath9k: Fix mismerge of do-not-access-hw-on-IRQ-reset
Restore the revert made by 5b1e4ee1cad:
ath9k: revert do-not-access-hw-on-IRQ-reset
And revert the companion to the original patch that was reverted:
ath9k: fix-race-condition-in-irq-processing-during-hardware-reset
by removing irq disabling in ath_reset_internal.
Fixes b/22067911
Change-Id: Ide6f927f4fd0b0e7b37632e9543ddf3af43abffb
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 75c2942..8c56ecd 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -285,7 +285,6 @@
__ath_cancel_work(sc);
- disable_irq(sc->irq);
tasklet_disable(&sc->intr_tq);
tasklet_disable(&sc->bcon_tasklet);
spin_lock_bh(&sc->sc_pcu_lock);
@@ -332,7 +331,6 @@
r = -EIO;
out:
- enable_irq(sc->irq);
spin_unlock_bh(&sc->sc_pcu_lock);
tasklet_enable(&sc->bcon_tasklet);
tasklet_enable(&sc->intr_tq);
@@ -518,6 +516,11 @@
if (!ath9k_hw_intrpend(ah))
return IRQ_NONE;
+ if (test_bit(ATH_OP_HW_RESET, &common->op_flags)) {
+ ath9k_hw_kill_interrupts(ah);
+ return IRQ_HANDLED;
+ }
+
/*
* Figure out the reason(s) for the interrupt. Note
* that the hal returns a pseudo-ISR that may include
@@ -528,9 +531,6 @@
ath9k_debug_sync_cause(sc, sync_cause);
status &= ah->imask; /* discard unasked-for bits */
- if (test_bit(ATH_OP_HW_RESET, &common->op_flags))
- return IRQ_HANDLED;
-
/*
* If there are no status bits set, then this interrupt was not
* for me (should have been caught above).
@@ -623,7 +623,6 @@
#ifdef CPTCFG_ATH9K_DEBUGFS
RESET_STAT_INC(sc, type);
#endif
- ath9k_hw_kill_interrupts(sc->sc_ah);
set_bit(ATH_OP_HW_RESET, &common->op_flags);
ieee80211_queue_work(sc->hw, &sc->hw_reset_work);
}