aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sharma <quic_sarishar@quicinc.com>2025-06-30 12:14:31 +0530
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>2025-07-07 15:34:49 -0700
commitacab697c32f7a38ec0e9721ac02febd295e8df74 (patch)
tree7cc2cf0082a97271ad6b09812bab409d9a0bef03
parentwifi: ath12k: Block radio bring-up in FTM mode (diff)
downloadlinux-acab697c32f7a38ec0e9721ac02febd295e8df74.tar.gz
linux-acab697c32f7a38ec0e9721ac02febd295e8df74.zip
wifi: ath12k: properly set bit for pdev mask for firmware PPDU_STATS request
Currently, the HTT_H2T_MSG_TYPE_PPDU_STATS_CFG request uses bits 8 to 15 as the bitmask for HTT_PPDU_STATS_CFG_PDEV_ID for firmware PPDU_STATS. However, bit 8 is reserved for SOC stats, and the actual PDEV ID should be encoded using bits 9 to 15. This leads to incorrect PDEV ID encoding in the request, causing it to either ignore the request or apply it to the wrong PDEV. Additionally, pdev_mask calculation is done as pdev_mask = 1 << (i + 1); (i.e. i= num_rxmda_per_pdev) but this is not valid for multiple pdevs(multi-MAC configurations) with 1 rxdma per pdev, as this will mask the same value for all pdevs. To correctly identify each and exact MAC in multi-MAC configurations, the calculation should include ar->pdev_idx: pdev_mask = 1 << i + ar->pdev_idx; Due to these issues, the firmware does not send PPDU_STATS for the intended PDEV, leading to inaccurate and incomplete statistics on the host. This might trigger certain WARN_ON() conditions in host that rely on these statistics. Hence, change the bitmask for HTT_PPDU_STATS_CFG_PDEV_ID as bit 9 to 15 to properly fill the pdev id in request message and change the pdev_mask calculation to consider ar->pdev_idx to mask pdev correctly. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Link: https://patch.msgid.link/20250630064431.3446333-1-quic_sarishar@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath12k/dp.h3
-rw-r--r--drivers/net/wireless/ath/ath12k/dp_tx.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
index 0c1fece27264..6df07b23b705 100644
--- a/drivers/net/wireless/ath/ath12k/dp.h
+++ b/drivers/net/wireless/ath/ath12k/dp.h
@@ -703,7 +703,8 @@ struct htt_ppdu_stats_cfg_cmd {
} __packed;
#define HTT_PPDU_STATS_CFG_MSG_TYPE GENMASK(7, 0)
-#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 8)
+#define HTT_PPDU_STATS_CFG_SOC_STATS BIT(8)
+#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 9)
#define HTT_PPDU_STATS_CFG_TLV_TYPE_BITMASK GENMASK(31, 16)
enum htt_ppdu_stats_tag_type {
diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
index ca3d97043da0..1fa37cda1046 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -1257,7 +1257,7 @@ int ath12k_dp_tx_htt_h2t_ppdu_stats_req(struct ath12k *ar, u32 mask)
cmd->msg = le32_encode_bits(HTT_H2T_MSG_TYPE_PPDU_STATS_CFG,
HTT_PPDU_STATS_CFG_MSG_TYPE);
- pdev_mask = 1 << (i + 1);
+ pdev_mask = 1 << (i + ar->pdev_idx);
cmd->msg |= le32_encode_bits(pdev_mask, HTT_PPDU_STATS_CFG_PDEV_ID);
cmd->msg |= le32_encode_bits(mask, HTT_PPDU_STATS_CFG_TLV_TYPE_BITMASK);