[PATCH ath-next] wifi: ath12k: properly set bit for pdev mask for firmware PPDU_STATS request
Sarika Sharma
quic_sarishar at quicinc.com
Sun Jun 29 23:44:31 PDT 2025
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 at quicinc.com>
---
drivers/net/wireless/ath/ath12k/dp.h | 3 ++-
drivers/net/wireless/ath/ath12k/dp_tx.c | 2 +-
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 a353333f83b6..a537c3420f91 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);
base-commit: 391a83d0c8ebb1e476cba73bf4c010af73993111
--
2.34.1
More information about the ath12k
mailing list