ath9k: Improve ath_tx_aggr_stop to avoid TID stuck in cleanup state.
PATCH v2 1/1 ath9k: Improve ath_tx_aggr_stop to avoid TID stuck in cleanup state.
From: kolya <[email protected]>
When tx agg is being stopped TID is flushed using ath_tx_flush_tid. It is possible that ath_tx_flush_tid completelly flushes TID (if all packets in this TID have already been retried). If this happened ath_tx_aggr_stop would leave TID in cleanup state permanently. Fix this by making ath_tx_flush_tid remove AGGR_ADDBA_COMPLETE and AGGR_CLEANUP flags from TID status if TID is empty.
--- drivers/net/wireless/ath/ath9k/xmit.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +6 -7
@@ -179,6 +179,11 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)spin_lock_bh (&txq->axq_lock); } +if (tid->baw_head == tid->baw_tail) { + tid->state &= ~AGGR_ADDBA_COMPLETE ; + tid->state &= ~AGGR_CLEANUP ; + } +spin_unlock_bh (&txq->axq_lock); }
@@ -556,15 +561,9 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,spin_unlock_bh (&txq->axq_lock); } -if (tid->state &AGGR_CLEANUP ) { +if (tid->state &AGGR_CLEANUP )ath_tx_flush_tid (sc, tid); -if (tid->baw_head == tid->baw_tail) { - tid->state &= ~AGGR_ADDBA_COMPLETE ; - tid->state &= ~AGGR_CLEANUP ; - } - } -rcu_read_unlock ();if (needreset) {
Signature · 1 line
1.7.4.1
PATCH v2 1/1 ath9k: Improve ath_tx_aggr_stop to avoid TID stuck in cleanup state.
Quoted 3 lines · Nikolay Martynov
From: kolya <[email protected]>
When tx agg is being stopped TID is flushed using
ath_tx_flush_tid. It is possible thatath_tx_flush_tidcompletelly flushes TID (if all packets in this TID have already been retried). If this happenedath_tx_aggr_stopwould leave TID in cleanup state permanently. Fix this by makingath_tx_flush_tidremoveAGGR_ADDBA_COMPLETEandAGGR_CLEANUPflags from TID status if TID is empty.
Please follow the suggestions Kalle made about your patch. Please also include a Signed-off-by line.
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you linville at tuxdriver.com might be all we have. Be ready.