Skip to contentSkip to conversation

ath9k: restore power mode on error path

PATCH New Gabor Juhos 1 participant 3 messages Jun 15, 2009 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: restore power mode on error path

The ath9k_ps_{wakeup,restore} calls must be in balance.

Changes-licensed-under: ISC

---
 drivers/net/wireless/ath/ath9k/main.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +6 -3
index f7baa40..af39143 100644
@@ -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
#1 lore raw

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

---
 drivers/net/wireless/ath/ath9k/ath9k.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +1 -0
index 9cd523f..b7dae21 100644
@@ -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
#2 lore raw

PATCH 1/1 ath9k: process rx packet if we are waiting for CAB

In reply to Gabor Juhos

If 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

---
 drivers/net/wireless/ath/ath9k/recv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/recv.c +1 -0
index 5014a19..f99f3a7 100644
@@ -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