Commit 9df0d6a2 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

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: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c0c11741
...@@ -2275,9 +2275,6 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop) ...@@ -2275,9 +2275,6 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
return; return;
} }
if (drop)
timeout = 1;
for (j = 0; j < timeout; j++) { for (j = 0; j < timeout; j++) {
bool npend = false; bool npend = false;
...@@ -2295,9 +2292,10 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop) ...@@ -2295,9 +2292,10 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
} }
if (!npend) if (!npend)
goto out; break;
} }
if (drop) {
ath9k_ps_wakeup(sc); ath9k_ps_wakeup(sc);
spin_lock_bh(&sc->sc_pcu_lock); spin_lock_bh(&sc->sc_pcu_lock);
drain_txq = ath_drain_all_txq(sc, false); drain_txq = ath_drain_all_txq(sc, false);
...@@ -2308,8 +2306,8 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop) ...@@ -2308,8 +2306,8 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
ieee80211_wake_queues(hw); ieee80211_wake_queues(hw);
}
out:
ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0); ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0);
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
} }
......
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