linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ath-next 0/3] wifi: ath: downgrade logging level for CE buffer enqueue failure
@ 2025-08-15  1:44 Baochen Qiang
  2025-08-15  1:44 ` [PATCH ath-next 1/3] wifi: ath11k: downgrade log " Baochen Qiang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Baochen Qiang @ 2025-08-15  1:44 UTC (permalink / raw)
  To: Jeff Johnson, Kalle Valo, Carl Huang, Karthikeyan Periyasamy,
	P Praneesh, Sriram R
  Cc: linux-wireless, ath11k, linux-kernel, Jeff Johnson,
	Balamurugan Selvarajan, Ramya Gnanasekar, ath12k, Baochen Qiang

The CE buffer enqueue failure won't cause any functional issue, downgrade
logging level to avoid misleading.

Also fix an incorrect debug ID usage for CE.

Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
---
Baochen Qiang (3):
      wifi: ath11k: downgrade log level for CE buffer enqueue failure
      wifi: ath12k: fix wrong logging ID used for CE
      wifi: ath12k: downgrade log level for CE buffer enqueue failure

 drivers/net/wireless/ath/ath11k/ce.c    | 3 ++-
 drivers/net/wireless/ath/ath12k/ce.c    | 5 +++--
 drivers/net/wireless/ath/ath12k/debug.h | 1 +
 3 files changed, 6 insertions(+), 3 deletions(-)
---
base-commit: 95bf875b89b48a95a82aca922eeaf19d52543028
change-id: 20250812-ath-dont-warn-on-ce-enqueue-fail-4a8ae2fcd1ae

Best regards,
-- 
Baochen Qiang <baochen.qiang@oss.qualcomm.com>


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

* [PATCH ath-next 1/3] wifi: ath11k: downgrade log level for CE buffer enqueue failure
  2025-08-15  1:44 [PATCH ath-next 0/3] wifi: ath: downgrade logging level for CE buffer enqueue failure Baochen Qiang
@ 2025-08-15  1:44 ` Baochen Qiang
  2025-08-15  1:44 ` [PATCH ath-next 2/3] wifi: ath12k: fix wrong logging ID used for CE Baochen Qiang
  2025-08-15  1:44 ` [PATCH ath-next 3/3] wifi: ath12k: downgrade log level for CE buffer enqueue failure Baochen Qiang
  2 siblings, 0 replies; 4+ messages in thread
From: Baochen Qiang @ 2025-08-15  1:44 UTC (permalink / raw)
  To: Jeff Johnson, Kalle Valo, Carl Huang, Karthikeyan Periyasamy,
	P Praneesh, Sriram R
  Cc: linux-wireless, ath11k, linux-kernel, Jeff Johnson,
	Balamurugan Selvarajan, Ramya Gnanasekar, ath12k, Baochen Qiang

There are two rings involved in the Copy Engine (CE) receive path
handling, the CE status (STS) ring and the CE destination (DST) ring.
Each time CE hardware needs to send an event (e.g. WMI event) to host,
CE hardware finds a buffer (to which the tail pointer (TP) points) in
DST ring and fills it with payload, then hardware fills meta data in
STS ring and fires interrupt to host. Please note the TP of DST ring is
expected to be advanced by CE hardware before interrupting host. While
handling the interrupt, host finds that DST ring buffers are used hence
increases rx_buf_needed to record the number of buffers to be replenished.
Note before that, host compares TP and head pointer (HP) of DST ring to
see if there is available space. Normally rx_buf_needed simply equals
available space. But sometimes CE hardware doesn't (for whatever reason)
update TP timely, making the comparison fails, then enqueue is cancelled
and a warning is logged:

	ath11k_pci 0000:02:00.0: failed to enqueue rx buf: -28

However even enqueue fails this time, rx_buf_needed still records the
numbers of needed buffers. Later when TP gets updated correctly, the
missing buffer will be eventually replenished. And there is no doubt on
the late update, it always comes (or lots of such warnings should be seen).

Since this won't cause any functional issue, downgrade logging level to
avoid misleading.

Compile tested only.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220269
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath11k/ce.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/ath/ath11k/ce.c
index c65fc9fb539ef10ba44f1c1d5571462b40fa098d..a7a163621b21067ba5a4f96131aafdccfbda3d03 100644
--- a/drivers/net/wireless/ath/ath11k/ce.c
+++ b/drivers/net/wireless/ath/ath11k/ce.c
@@ -354,7 +354,8 @@ static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe)
 		ret = ath11k_ce_rx_buf_enqueue_pipe(pipe, skb, paddr);
 
 		if (ret) {
-			ath11k_warn(ab, "failed to enqueue rx buf: %d\n", ret);
+			ath11k_dbg(ab, ATH11K_DBG_CE, "failed to enqueue rx buf: %d\n",
+				   ret);
 			dma_unmap_single(ab->dev, paddr,
 					 skb->len + skb_tailroom(skb),
 					 DMA_FROM_DEVICE);

-- 
2.25.1


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

* [PATCH ath-next 2/3] wifi: ath12k: fix wrong logging ID used for CE
  2025-08-15  1:44 [PATCH ath-next 0/3] wifi: ath: downgrade logging level for CE buffer enqueue failure Baochen Qiang
  2025-08-15  1:44 ` [PATCH ath-next 1/3] wifi: ath11k: downgrade log " Baochen Qiang
@ 2025-08-15  1:44 ` Baochen Qiang
  2025-08-15  1:44 ` [PATCH ath-next 3/3] wifi: ath12k: downgrade log level for CE buffer enqueue failure Baochen Qiang
  2 siblings, 0 replies; 4+ messages in thread
From: Baochen Qiang @ 2025-08-15  1:44 UTC (permalink / raw)
  To: Jeff Johnson, Kalle Valo, Carl Huang, Karthikeyan Periyasamy,
	P Praneesh, Sriram R
  Cc: linux-wireless, ath11k, linux-kernel, Jeff Johnson,
	Balamurugan Selvarajan, Ramya Gnanasekar, ath12k, Baochen Qiang

ATH12K_DBG_AHB is used for CE logging which is not proper. Add
ATH12K_DBG_CE and replace ATH12K_DBG_AHB with it.

Compile tested only.

Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/ce.c    | 2 +-
 drivers/net/wireless/ath/ath12k/debug.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/ce.c b/drivers/net/wireless/ath/ath12k/ce.c
index f93a419abf65ec6e9b31e22c78c8c2cdd7bdbc76..c5aadbc6367ce0d18080bb0e15a88d3ddf2e34ff 100644
--- a/drivers/net/wireless/ath/ath12k/ce.c
+++ b/drivers/net/wireless/ath/ath12k/ce.c
@@ -478,7 +478,7 @@ static void ath12k_ce_recv_process_cb(struct ath12k_ce_pipe *pipe)
 	}
 
 	while ((skb = __skb_dequeue(&list))) {
-		ath12k_dbg(ab, ATH12K_DBG_AHB, "rx ce pipe %d len %d\n",
+		ath12k_dbg(ab, ATH12K_DBG_CE, "rx ce pipe %d len %d\n",
 			   pipe->pipe_num, skb->len);
 		pipe->recv_cb(ab, skb);
 	}
diff --git a/drivers/net/wireless/ath/ath12k/debug.h b/drivers/net/wireless/ath/ath12k/debug.h
index 48916e4e1f6014055bbd56d5c71ef9182c78f3b6..bf254e43a68d08f97171d9baffd0ebc3aabfb3e4 100644
--- a/drivers/net/wireless/ath/ath12k/debug.h
+++ b/drivers/net/wireless/ath/ath12k/debug.h
@@ -26,6 +26,7 @@ enum ath12k_debug_mask {
 	ATH12K_DBG_DP_TX	= 0x00002000,
 	ATH12K_DBG_DP_RX	= 0x00004000,
 	ATH12K_DBG_WOW		= 0x00008000,
+	ATH12K_DBG_CE		= 0x00010000,
 	ATH12K_DBG_ANY		= 0xffffffff,
 };
 

-- 
2.25.1


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

* [PATCH ath-next 3/3] wifi: ath12k: downgrade log level for CE buffer enqueue failure
  2025-08-15  1:44 [PATCH ath-next 0/3] wifi: ath: downgrade logging level for CE buffer enqueue failure Baochen Qiang
  2025-08-15  1:44 ` [PATCH ath-next 1/3] wifi: ath11k: downgrade log " Baochen Qiang
  2025-08-15  1:44 ` [PATCH ath-next 2/3] wifi: ath12k: fix wrong logging ID used for CE Baochen Qiang
@ 2025-08-15  1:44 ` Baochen Qiang
  2 siblings, 0 replies; 4+ messages in thread
From: Baochen Qiang @ 2025-08-15  1:44 UTC (permalink / raw)
  To: Jeff Johnson, Kalle Valo, Carl Huang, Karthikeyan Periyasamy,
	P Praneesh, Sriram R
  Cc: linux-wireless, ath11k, linux-kernel, Jeff Johnson,
	Balamurugan Selvarajan, Ramya Gnanasekar, ath12k, Baochen Qiang

There are two rings involved in the Copy Engine (CE) receive path
handling, the CE status (STS) ring and the CE destination (DST) ring.
Each time CE hardware needs to send an event (e.g. WMI event) to host,
CE hardware finds a buffer (to which the tail pointer (TP) points) in
DST ring and fills it with payload, then hardware fills meta data in
STS ring and fires interrupt to host. Please note the TP of DST ring is
expected to be advanced by CE hardware before interrupting host. While
handling the interrupt, host finds that DST ring buffers are used hence
increases rx_buf_needed to record the number of buffers to be replenished.
Note before that, host compares TP and head pointer (HP) of DST ring to
see if there is available space. Normally rx_buf_needed simply equals
available space. But sometimes CE hardware doesn't (for whatever reason)
update TP timely, making the comparison fails, then enqueue is cancelled
and a warning is logged.

However even enqueue fails this time, rx_buf_needed still records the
numbers of needed buffers. Later when TP gets updated correctly, the
missing buffer will be eventually replenished. And there is no doubt on
the late update, it always comes (or lots of such warnings should be seen).

Since this won't cause any functional issue, downgrade logging level to
avoid misleading.

Compile tested only.

Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/ce.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/ce.c b/drivers/net/wireless/ath/ath12k/ce.c
index c5aadbc6367ce0d18080bb0e15a88d3ddf2e34ff..9a63608838ace31587691dd53c1d4aa8f081cb6f 100644
--- a/drivers/net/wireless/ath/ath12k/ce.c
+++ b/drivers/net/wireless/ath/ath12k/ce.c
@@ -392,7 +392,8 @@ static int ath12k_ce_rx_post_pipe(struct ath12k_ce_pipe *pipe)
 
 		ret = ath12k_ce_rx_buf_enqueue_pipe(pipe, skb, paddr);
 		if (ret) {
-			ath12k_warn(ab, "failed to enqueue rx buf: %d\n", ret);
+			ath12k_dbg(ab, ATH12K_DBG_CE, "failed to enqueue rx buf: %d\n",
+				   ret);
 			dma_unmap_single(ab->dev, paddr,
 					 skb->len + skb_tailroom(skb),
 					 DMA_FROM_DEVICE);

-- 
2.25.1


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

end of thread, other threads:[~2025-08-15  1:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15  1:44 [PATCH ath-next 0/3] wifi: ath: downgrade logging level for CE buffer enqueue failure Baochen Qiang
2025-08-15  1:44 ` [PATCH ath-next 1/3] wifi: ath11k: downgrade log " Baochen Qiang
2025-08-15  1:44 ` [PATCH ath-next 2/3] wifi: ath12k: fix wrong logging ID used for CE Baochen Qiang
2025-08-15  1:44 ` [PATCH ath-next 3/3] wifi: ath12k: downgrade log level for CE buffer enqueue failure Baochen Qiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).