Skip to contentSkip to conversation

wifi: ath9k: return ath_buf to pool on A-MPDU subframe retry

PATCH New Rosen Penev 1 participant 1 message Jun 26 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wifi: ath9k: return ath_buf to pool on A-MPDU subframe retry

When an A-MPDU subframe needs retransmission, its ath_buf descriptor was moved to a local bf_head list that went out of scope without returning the buffer to the free pool (sc->tx.txbuf). This progressively depletes the 512-entry TX buffer pool under normal retransmission conditions, eventually stalling all TX.

Unmap the DMA mapping (a new one will be created on retry), clear the buffer references including fi->bf to prevent reuse of the freed descriptor on retry, and return it to the pool via ath_tx_return_buffer.

Assisted-by opencode:big-pickle

---
v2: set fi-bf to NULL.

 drivers/net/wireless/ath/ath9k/xmit.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/net/wireless/ath/ath9k/xmit.c +10 -0
index 3334f570be50..31187753a819 100644
@@ -665,6 +665,16 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
 			 * queue to retain ordering
 			 */
 			__skb_queue_tail(&bf_pending, skb);
+
+			if (!list_empty(&bf_head)) {
+				dma_unmap_single(sc->dev, bf->bf_buf_addr,
+						 skb->len, DMA_TO_DEVICE);
+				bf->bf_buf_addr = 0;
+				bf->bf_mpdu = NULL;
+				fi->bf = NULL;
+				list_del(&bf->list);
+				ath_tx_return_buffer(sc, bf);
+			}
 		}
 
 		bf = bf_next;

--
2.54.0