Skip to content

Commit

Permalink
ath9k: only drop packets in drv_flush when asked to
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Dec 7, 2011
1 parent c0c1174 commit 9df0d6a
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2275,9 +2275,6 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
return;
}

if (drop)
timeout = 1;

for (j = 0; j < timeout; j++) {
bool npend = false;

Expand All @@ -2295,21 +2292,22 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
}

if (!npend)
goto out;
break;
}

ath9k_ps_wakeup(sc);
spin_lock_bh(&sc->sc_pcu_lock);
drain_txq = ath_drain_all_txq(sc, false);
spin_unlock_bh(&sc->sc_pcu_lock);
if (drop) {
ath9k_ps_wakeup(sc);
spin_lock_bh(&sc->sc_pcu_lock);
drain_txq = ath_drain_all_txq(sc, false);
spin_unlock_bh(&sc->sc_pcu_lock);

if (!drain_txq)
ath_reset(sc, false);
if (!drain_txq)
ath_reset(sc, false);

ath9k_ps_restore(sc);
ieee80211_wake_queues(hw);
ath9k_ps_restore(sc);
ieee80211_wake_queues(hw);
}

out:
ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0);
mutex_unlock(&sc->mutex);
}
Expand Down

0 comments on commit 9df0d6a

Please sign in to comment.