]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: ath12k: Add drop descriptor handling for monitor ring
authorP Praneesh <quic_ppranees@quicinc.com>
Mon, 23 Dec 2024 06:01:26 +0000 (11:31 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Sun, 26 Jan 2025 18:41:29 +0000 (10:41 -0800)
When monitor block in Hardware experiences internal backpressure, a ring
entry with the EMPTY_DESC reason is received in the monitor destination
ring descriptor. The cookie field for this corresponding entry is invalid.
Currently driver attempts to process this cookie resulting in invalid
buf_id warning logs flooding the console. To fix this, skip processing the
destination descriptor when the EMPTY_DESCRIPTOR bit is set to true in ring
descriptor, thereby avoiding the processing of junk cookies.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
Link: https://patch.msgid.link/20241223060132.3506372-9-quic_ppranees@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_mon.c

index 236456b02198c81bdc750aca2a709718cf2db30f..bf43ef2b6b39d0660f266582ad0b260820be9066 100644 (file)
@@ -2347,6 +2347,14 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int *budget,
                if (unlikely(!mon_dst_desc))
                        break;
 
+               /* In case of empty descriptor, the cookie in the ring descriptor
+                * is invalid. Therefore, this entry is skipped, and ring processing
+                * continues.
+                */
+               info0 = le32_to_cpu(mon_dst_desc->info0);
+               if (u32_get_bits(info0, HAL_MON_DEST_INFO0_EMPTY_DESC))
+                       goto move_next;
+
                cookie = le32_to_cpu(mon_dst_desc->cookie);
                buf_id = u32_get_bits(cookie, DP_RXDMA_BUF_COOKIE_BUF_ID);