Commit 783cd01e authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath9k: add missing ps wakeup/restore calls

There are several places where ath_reset() was called without proper
calls to ath9k_ps_wakeup/ath9k_ps_restore. To fix this, add those calls
directly to ath_reset and drop them from callers where it makes sense.

Also add them to the config callback around ath_update_txpow to fix a
crash that happens when the tx power changed before any vif is brought up.
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6f481010
...@@ -592,14 +592,12 @@ void ath9k_tasklet(unsigned long data) ...@@ -592,14 +592,12 @@ void ath9k_tasklet(unsigned long data)
u32 status = sc->intrstatus; u32 status = sc->intrstatus;
u32 rxmask; u32 rxmask;
ath9k_ps_wakeup(sc);
if (status & ATH9K_INT_FATAL) { if (status & ATH9K_INT_FATAL) {
ath_reset(sc, true); ath_reset(sc, true);
ath9k_ps_restore(sc);
return; return;
} }
ath9k_ps_wakeup(sc);
spin_lock(&sc->sc_pcu_lock); spin_lock(&sc->sc_pcu_lock);
if (!ath9k_hw_check_alive(ah)) if (!ath9k_hw_check_alive(ah))
...@@ -969,6 +967,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) ...@@ -969,6 +967,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
/* Stop ANI */ /* Stop ANI */
del_timer_sync(&common->ani.timer); del_timer_sync(&common->ani.timer);
ath9k_ps_wakeup(sc);
spin_lock_bh(&sc->sc_pcu_lock); spin_lock_bh(&sc->sc_pcu_lock);
ieee80211_stop_queues(hw); ieee80211_stop_queues(hw);
...@@ -1015,6 +1014,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) ...@@ -1015,6 +1014,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
/* Start ANI */ /* Start ANI */
ath_start_ani(common); ath_start_ani(common);
ath9k_ps_restore(sc);
return r; return r;
} }
...@@ -1701,7 +1701,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) ...@@ -1701,7 +1701,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
skip_chan_change: skip_chan_change:
if (changed & IEEE80211_CONF_CHANGE_POWER) { if (changed & IEEE80211_CONF_CHANGE_POWER) {
sc->config.txpowlimit = 2 * conf->power_level; sc->config.txpowlimit = 2 * conf->power_level;
ath9k_ps_wakeup(sc);
ath_update_txpow(sc); ath_update_txpow(sc);
ath9k_ps_restore(sc);
} }
spin_lock_bh(&sc->wiphy_lock); spin_lock_bh(&sc->wiphy_lock);
......
...@@ -2113,9 +2113,7 @@ static void ath_tx_complete_poll_work(struct work_struct *work) ...@@ -2113,9 +2113,7 @@ static void ath_tx_complete_poll_work(struct work_struct *work)
if (needreset) { if (needreset) {
ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_RESET, ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_RESET,
"tx hung, resetting the chip\n"); "tx hung, resetting the chip\n");
ath9k_ps_wakeup(sc);
ath_reset(sc, true); ath_reset(sc, true);
ath9k_ps_restore(sc);
} }
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment