aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-11-16 07:08:42 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-07 15:19:35 -0500
commit9df0d6a20a4e6d15684cc8f2e3f0155be0801592 (patch)
tree9bf0f2997f7d725a18828eca685faeaa92465bc9 /drivers/net/wireless/ath/ath9k/main.c
parentc0c1174144dd619456be5930d733028a055ef425 (diff)
ath9k: only drop packets in drv_flush when asked to
Recently more places in mac80211 call drv_flush to ensure proper order for state changes wrt. powersave, channel changes, etc. On some systems such calls lead to spurious logspam about failing to stop tx dma, as well as hardware resets that go along with that. Instead of dropping packets in a place where it's completely unnecessary, only do it when drop == true. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 8b0feecf3fae..36315c83d4ca 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2275,9 +2275,6 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
2275 return; 2275 return;
2276 } 2276 }
2277 2277
2278 if (drop)
2279 timeout = 1;
2280
2281 for (j = 0; j < timeout; j++) { 2278 for (j = 0; j < timeout; j++) {
2282 bool npend = false; 2279 bool npend = false;
2283 2280
@@ -2295,21 +2292,22 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
2295 } 2292 }
2296 2293
2297 if (!npend) 2294 if (!npend)
2298 goto out; 2295 break;
2299 } 2296 }
2300 2297
2301 ath9k_ps_wakeup(sc); 2298 if (drop) {
2302 spin_lock_bh(&sc->sc_pcu_lock); 2299 ath9k_ps_wakeup(sc);
2303 drain_txq = ath_drain_all_txq(sc, false); 2300 spin_lock_bh(&sc->sc_pcu_lock);
2304 spin_unlock_bh(&sc->sc_pcu_lock); 2301 drain_txq = ath_drain_all_txq(sc, false);
2302 spin_unlock_bh(&sc->sc_pcu_lock);
2305 2303
2306 if (!drain_txq) 2304 if (!drain_txq)
2307 ath_reset(sc, false); 2305 ath_reset(sc, false);
2308 2306
2309 ath9k_ps_restore(sc); 2307 ath9k_ps_restore(sc);
2310 ieee80211_wake_queues(hw); 2308 ieee80211_wake_queues(hw);
2309 }
2311 2310
2312out:
2313 ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0); 2311 ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0);
2314 mutex_unlock(&sc->mutex); 2312 mutex_unlock(&sc->mutex);
2315} 2313}