Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH ath-next] wifi: ath10k: simplify ath10k_htt_tx_mgmt_inc_pending
@ 2025-10-31 11:16 Zhi-Jun You
  2025-10-31 15:00 ` Jeff Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Zhi-Jun You @ 2025-10-31 11:16 UTC (permalink / raw)
  To: jjohnson; +Cc: ath10k, linux-wireless, 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.

Signed-off-by: Zhi-Jun You <hujy652@gmail.com>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 603f6de62b0a..d94f63637810 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -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);
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index d6f1d85ba871..0cf30068447b 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -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 &&
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index da6f7957a0ae..6d77d451988a 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -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);
 	}
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH ath-next] wifi: ath10k: simplify ath10k_htt_tx_mgmt_inc_pending
  2025-10-31 11:16 [PATCH ath-next] wifi: ath10k: simplify ath10k_htt_tx_mgmt_inc_pending Zhi-Jun You
@ 2025-10-31 15:00 ` Jeff Johnson
  2025-11-01  8:33   ` Zhi-Jun You
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Johnson @ 2025-10-31 15:00 UTC (permalink / raw)
  To: Zhi-Jun You, jjohnson; +Cc: ath10k, linux-wireless

On 10/31/2025 4:16 AM, Zhi-Jun You wrote:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH ath-next] wifi: ath10k: simplify ath10k_htt_tx_mgmt_inc_pending
  2025-10-31 15:00 ` Jeff Johnson
@ 2025-11-01  8:33   ` Zhi-Jun You
  0 siblings, 0 replies; 3+ messages in thread
From: Zhi-Jun You @ 2025-11-01  8:33 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: jjohnson, ath10k, linux-wireless

On Fri, Oct 31, 2025 at 11:00 PM Jeff Johnson
<jeff.johnson@oss.qualcomm.com> wrote:
>
> On 10/31/2025 4:16 AM, Zhi-Jun You wrote:
> > 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-01  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 11:16 [PATCH ath-next] wifi: ath10k: simplify ath10k_htt_tx_mgmt_inc_pending Zhi-Jun You
2025-10-31 15:00 ` Jeff Johnson
2025-11-01  8:33   ` Zhi-Jun You

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox