Skip to contentSkip to conversation

wifi: ath10k: simplify ath10k_htt_tx_mgmt_inc_pending

PATCH In review Zhi-Jun You 2 participants 3 messages Oct 31, 2025 – Nov 1, 2025 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: ath10k: simplify ath10k_htt_tx_mgmt_inc_pending

Remove is_mgmt from ath10k_htt_tx_mgmt_inc_pending and make sure we only call it when it's a mgmt frame.

---
 drivers/net/wireless/ath/ath10k/htt.h    |  3 +--
 drivers/net/wireless/ath/ath10k/htt_tx.c |  5 ++---
 drivers/net/wireless/ath/ath10k/mac.c    | 20 +++++++++++---------
 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/net/wireless/ath/ath10k/htt.h +1 -2
index 603f6de62b0a..d94f63637810 100644
@@ -2450,8 +2450,7 @@ void ath10k_htt_tx_txq_sync(struct ath10k *ar);
 void ath10k_htt_tx_dec_pending(struct ath10k_htt *htt);
 int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt);
 void ath10k_htt_tx_mgmt_dec_pending(struct ath10k_htt *htt);
-int ath10k_htt_tx_mgmt_inc_pending(struct ath10k_htt *htt, bool is_mgmt,
-				   bool is_presp);
+int ath10k_htt_tx_mgmt_inc_pending(struct ath10k_htt *htt, bool is_presp);
 
 int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt, struct sk_buff *skb);
 void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id);
drivers/net/wireless/ath/ath10k/htt_tx.c +2 -3
index d6f1d85ba871..0cf30068447b 100644
@@ -168,14 +168,13 @@ int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt)
 	return 0;
 }
 
-int ath10k_htt_tx_mgmt_inc_pending(struct ath10k_htt *htt, bool is_mgmt,
-				   bool is_presp)
+int ath10k_htt_tx_mgmt_inc_pending(struct ath10k_htt *htt, bool is_presp)
 {
 	struct ath10k *ar = htt->ar;
 
 	lockdep_assert_held(&htt->tx_lock);
 
-	if (!is_mgmt || !ar->hw_params.max_probe_resp_desc_thres)
+	if (!ar->hw_params.max_probe_resp_desc_thres)
 		return 0;
 
 	if (is_presp &&
drivers/net/wireless/ath/ath10k/mac.c +11 -9
index da6f7957a0ae..6d77d451988a 100644
@@ -4442,7 +4442,7 @@ int ath10k_mac_tx_push_txq(struct ieee80211_hw *hw,
 		is_presp = ieee80211_is_probe_resp(hdr->frame_control);
 
 		spin_lock_bh(&ar->htt.tx_lock);
-		ret = ath10k_htt_tx_mgmt_inc_pending(htt, is_mgmt, is_presp);
+		ret = ath10k_htt_tx_mgmt_inc_pending(htt, is_presp);
 
 		if (ret) {
 			ath10k_htt_tx_dec_pending(htt);
@@ -4728,14 +4728,16 @@ static void ath10k_mac_op_tx(struct ieee80211_hw *hw,
 			return;
 		}
 
-		ret = ath10k_htt_tx_mgmt_inc_pending(htt, is_mgmt, is_presp);
-		if (ret) {
-			ath10k_dbg(ar, ATH10K_DBG_MAC, "failed to increase tx mgmt pending count: %d, dropping\n",
-				   ret);
-			ath10k_htt_tx_dec_pending(htt);
-			spin_unlock_bh(&ar->htt.tx_lock);
-			ieee80211_free_txskb(ar->hw, skb);
-			return;
+		if (is_mgmt) {
+			ret = ath10k_htt_tx_mgmt_inc_pending(htt, is_presp);
+			if (ret) {
+				ath10k_dbg(ar, ATH10K_DBG_MAC, "failed to increase tx mgmt pending count: %d, dropping\n",
+					   ret);
+				ath10k_htt_tx_dec_pending(htt);
+				spin_unlock_bh(&ar->htt.tx_lock);
+				ieee80211_free_txskb(ar->hw, skb);
+				return;
+			}
 		}
 		spin_unlock_bh(&ar->htt.tx_lock);
 	}
Signature · 1 line
2.51.0
#2 lore raw
Quoted 8 lines · Jeff Johnson
Quoted 2 lines · Zhi-Jun You

Remove is_mgmt from ath10k_htt_tx_mgmt_inc_pending and make sure we only call it when it's a mgmt frame.

This fails to describe WHY the patch is needed

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes

Hi Jeff,

My apologies. I will try to describe it in this mail and update it in v2 if it looks good to you.

ath10k_htt_tx_mgmt_inc_pending() is called in ath10k_mac_tx_push_txq() and ath10k_mac_op_tx().
In ath10k_mac_tx_push_txq(), it checks is_mgmt before calling ath10k_htt_tx_mgmt_inc_pending() but there's another is_mgmt check inside which looks redundant.
The function name itself already indicates that it's for mgmt frame only.

This patch removed the is_mgmt check in ath10k_htt_tx_mgmt_inc_pending() and add an is_mgmt check in ath10k_mac_op_tx() to make sure it's only called for mgmt frames.

Thanks for taking your time.

Best regards,
Zhi-Jun