Skip to contentSkip to conversation

wifi: ath9k_htc: free an unsent frame with ieee80211_free_txskb()

PATCH Applied Mehmet Fide 2 participants 2 messages Nov 18 – Nov 19 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: ath9k_htc: free an unsent frame with ieee80211_free_txskb()

From: Mehmet Fide <[email protected]>

When ath9k_htc_tx() cannot send a frame, for example because the USB send fails or no TX slot is free, it frees the frame with dev_kfree_skb_any(). mac80211 keeps a copy of a frame whose TX status was asked for, such as an authentication response of hostapd, until the driver reports that frame. Freed this way, the frame is never
reported: the sender gets no TX status, and mac80211 holds the copy until the device is unregistered, where it warns:

Have pending ack frames!

  WARNING: net/mac80211/main.c:1761 at ieee80211_free_ack_frame+0x4c/0x70 [mac80211]

Free the frame with ieee80211_free_txskb(), which reports it as not acknowledged.

Fixes fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.")

---

Notes:
Tested on an i.MX8MP board with an AR9271 as AP (hostapd), ath9k_htc of this base. A test hook in htc_issue_send() fails the send of the first two frames with a TX status request while a station joins, after the driver headers are pushed; both are authentication responses. Without the patch no TX status event is reported for them (iw event) and the unload of the driver warns as above. With it both are reported as not acknowledged and the unload does not warn, 2 of 2 runs each. The station joins in both cases.

This applies on top of "wifi: ath9k_htc: count a frame as queued before it is sent" v2, both change the end of ath9k_htc_tx():
https://lore.kernel.org/r/[email protected]/

 drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +1 -1
index 3c52e66c79f4..7f85e980fc81 100644
@@ -902,7 +902,7 @@ static void ath9k_htc_tx(struct ieee80211_hw *hw,
 	__ath9k_htc_check_wake_queues(priv, true);
 	ath9k_htc_tx_clear_slot(priv, slot);
 fail_tx:
-	dev_kfree_skb_any(skb);
+	ieee80211_free_txskb(hw, skb);
 }
 
 static int ath9k_htc_start(struct ieee80211_hw *hw)

base-commit: 465fcc982a221f774594aa7d7351fde8c03a3deb
prerequisite-patch-id: 9b2187facf209488bb53b815bff10f3731764adc

Signature · 1 line
2.56.0