From 10ffb6a77e617a8f5ded84b504550759ec4a8df0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 11 Nov 2013 22:23:34 +0100 Subject: [PATCH] ath9k: optimize ath_drain_all_txq If the software has processed all packets, checking the hardware queue is unnecessary. Signed-off-by: Felix Fietkau Signed-off-by: John W. Linville --- drivers/net/wireless/ath/ath9k/xmit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 95f6c5a8ee12..24846d91554b 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -1786,6 +1786,9 @@ bool ath_drain_all_txq(struct ath_softc *sc) if (!ATH_TXQ_SETUP(sc, i)) continue; + if (!sc->tx.txq[i].axq_depth) + continue; + if (ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum)) npend |= BIT(i); }