ath9k: restore power mode on error path
PATCH 1/1 ath9k: restore power mode on error path
The ath9k_ps_{wakeup,restore} calls must be in balance.
Changes-licensed-under: ISC
Signed-off-by Gabor Juhos <[email protected]>
--- drivers/net/wireless/ath/ath9k/main.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +6 -3
@@ -283,7 +283,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,"reset status %d\n" , channel->center_freq, r);spin_unlock_bh (&sc->sc_resetlock); -return r; + goto ps_restore; }spin_unlock_bh (&sc->sc_resetlock);
@@ -292,14 +292,17 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,if (ath_startrecv (sc) !=0 ) {DPRINTF (sc,ATH_DBG_FATAL ,"Unable to restart recv logic\n" ); -return -EIO ; + r = -EIO ; + goto ps_restore; }ath_cache_conf_rate (sc, &hw->conf);ath_update_txpow (sc);ath9k_hw_set_interrupts (ah, sc->imask); + + ps_restore:ath9k_ps_restore (sc); -return 0 ; +return r; }/*
Signature · 1 line
1.5.3.2
PATCH 1/1 ath9k: prevent sleeping while we are waiting for CAB
We have to remain awake if the SC_OP_WAIT_FOR_CAB flag is set.
Changes-licensed-under: ISC
Signed-off-by Gabor Juhos <[email protected]>
--- drivers/net/wireless/ath/ath9k/ath9k.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +1 -0
@@ -681,6 +681,7 @@ static inline void ath9k_ps_restore(struct ath_softc *sc)if (atomic_dec_and_test (&sc->ps_usecount))if ((sc->hw->conf.flags &IEEE80211_CONF_PS ) && !(sc->sc_flags & (SC_OP_WAIT_FOR_BEACON | +SC_OP_WAIT_FOR_CAB |SC_OP_WAIT_FOR_PSPOLL_DATA |SC_OP_WAIT_FOR_TX_ACK ))) ath9k_hw_setpower(sc->sc_ah,
Signature · 1 line
1.5.3.2
PATCH 1/1 ath9k: process rx packet if we are waiting for CAB
In reply to Gabor JuhosIf we are in PS mode, we have to process the received frame if the SC_OP_WAIT_FOR_CAB bit is set.
Changes-licensed-under: ISC
Signed-off-by Gabor Juhos <[email protected]>
--- drivers/net/wireless/ath/ath9k/recv.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/recv.c +1 -0
@@ -817,6 +817,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) }if (unlikely (sc->sc_flags & (SC_OP_WAIT_FOR_BEACON | +SC_OP_WAIT_FOR_CAB |SC_OP_WAIT_FOR_PSPOLL_DATA )))ath_rx_ps (sc, skb);
Signature · 1 line
1.5.3.2