Skip to content

Commit 783cd01

Browse files
Felix Fietkaulinvjw
authored andcommitted
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: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 6f48101 commit 783cd01

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/net/wireless/ath/ath9k/main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,14 +592,12 @@ void ath9k_tasklet(unsigned long data)
592592
u32 status = sc->intrstatus;
593593
u32 rxmask;
594594

595-
ath9k_ps_wakeup(sc);
596-
597595
if (status & ATH9K_INT_FATAL) {
598596
ath_reset(sc, true);
599-
ath9k_ps_restore(sc);
600597
return;
601598
}
602599

600+
ath9k_ps_wakeup(sc);
603601
spin_lock(&sc->sc_pcu_lock);
604602

605603
if (!ath9k_hw_check_alive(ah))
@@ -969,6 +967,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
969967
/* Stop ANI */
970968
del_timer_sync(&common->ani.timer);
971969

970+
ath9k_ps_wakeup(sc);
972971
spin_lock_bh(&sc->sc_pcu_lock);
973972

974973
ieee80211_stop_queues(hw);
@@ -1015,6 +1014,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
10151014

10161015
/* Start ANI */
10171016
ath_start_ani(common);
1017+
ath9k_ps_restore(sc);
10181018

10191019
return r;
10201020
}
@@ -1701,7 +1701,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
17011701
skip_chan_change:
17021702
if (changed & IEEE80211_CONF_CHANGE_POWER) {
17031703
sc->config.txpowlimit = 2 * conf->power_level;
1704+
ath9k_ps_wakeup(sc);
17041705
ath_update_txpow(sc);
1706+
ath9k_ps_restore(sc);
17051707
}
17061708

17071709
spin_lock_bh(&sc->wiphy_lock);

drivers/net/wireless/ath/ath9k/xmit.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,9 +2113,7 @@ static void ath_tx_complete_poll_work(struct work_struct *work)
21132113
if (needreset) {
21142114
ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_RESET,
21152115
"tx hung, resetting the chip\n");
2116-
ath9k_ps_wakeup(sc);
21172116
ath_reset(sc, true);
2118-
ath9k_ps_restore(sc);
21192117
}
21202118

21212119
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,

0 commit comments

Comments
 (0)