Commit cf1187b3 authored by Dinesh Karthikeyan's avatar Dinesh Karthikeyan Committed by Kalle Valo

wifi: ath12k: Support pdev error stats

Add support to request pdev error stats from firmware through HTT stats
type 5. This stats type gives information such as list of pdev errors,
reasons for reset, logging information about recovery, drain and war
stats. etc.

Sample output:
-------------
echo 5 > /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats_type
cat /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats

HTT_HW_STATS_PDEV_ERRS_TLV:
mac_id = 0
tx_abort = 0
tx_abort_fail_count = 0
rx_abort = 53
.....

PDEV_PHY_WARM_RESET_REASONS:
phy_warm_reset_reason_phy_m3 = 0
phy_warm_reset_reason_tx_hw_stuck = 0
phy_warm_reset_reason_num_cca_rx_frame_stuck = 0
.....

WAL_RX_RECOVERY_STATS:
wal_rx_recovery_rst_mac_hang_count = 0
wal_rx_recovery_rst_known_sig_count = 0
wal_rx_recovery_rst_no_rx_count = 0
.....

HTT_RX_DEST_DRAIN_STATS:
rx_dest_drain_rx_descs_leak_prevention_done = 0
rx_dest_drain_rx_descs_saved_cnt = 0
rx_dest_drain_rxdma2reo_leak_detected = 0
.....

HTT_HW_STATS_INTR_MISC_TLV:
hw_intr_name = AMPI
mask = 0
count = 2

HTT_HW_STATS_WHAL_TX_TLV:
mac_id = 0
last_unpause_ppdu_id = 0
hwsch_unpause_wait_tqm_write = 0
.....

HTT_HW_WAR_STATS_TLV:
mac_id = 0
hw_war 0 = 0
hw_war 1 = 0
.....

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
Signed-off-by: default avatarDinesh Karthikeyan <quic_dinek@quicinc.com>
Signed-off-by: default avatarRoopni Devanathan <quic_rdevanat@quicinc.com>
Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20240625042217.1303332-3-quic_rdevanat@quicinc.com
parent 4b6dfc75
......@@ -126,6 +126,7 @@ enum ath12k_dbg_htt_ext_stats_type {
ATH12K_DBG_HTT_EXT_STATS_RESET = 0,
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX = 1,
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX_SCHED = 4,
ATH12K_DBG_HTT_EXT_STATS_PDEV_ERROR = 5,
/* keep this last */
ATH12K_DBG_HTT_NUM_EXT_STATS,
......@@ -140,9 +141,13 @@ enum ath12k_dbg_htt_tlv_tag {
HTT_STATS_TX_SCHED_CMN_TAG = 37,
HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39,
HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44,
HTT_STATS_HW_INTR_MISC_TAG = 54,
HTT_STATS_HW_PDEV_ERRS_TAG = 56,
HTT_STATS_WHAL_TX_TAG = 66,
HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67,
HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86,
HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87,
HTT_STATS_HW_WAR_TAG = 89,
HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100,
HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102,
HTT_STATS_MU_PPDU_DIST_TAG = 129,
......@@ -378,4 +383,83 @@ struct ath12k_htt_sched_txq_supercycle_triggers_tlv {
DECLARE_FLEX_ARRAY(__le32, supercycle_triggers);
} __packed;
struct ath12k_htt_hw_stats_pdev_errs_tlv {
__le32 mac_id__word;
__le32 tx_abort;
__le32 tx_abort_fail_count;
__le32 rx_abort;
__le32 rx_abort_fail_count;
__le32 warm_reset;
__le32 cold_reset;
__le32 tx_flush;
__le32 tx_glb_reset;
__le32 tx_txq_reset;
__le32 rx_timeout_reset;
__le32 mac_cold_reset_restore_cal;
__le32 mac_cold_reset;
__le32 mac_warm_reset;
__le32 mac_only_reset;
__le32 phy_warm_reset;
__le32 phy_warm_reset_ucode_trig;
__le32 mac_warm_reset_restore_cal;
__le32 mac_sfm_reset;
__le32 phy_warm_reset_m3_ssr;
__le32 phy_warm_reset_reason_phy_m3;
__le32 phy_warm_reset_reason_tx_hw_stuck;
__le32 phy_warm_reset_reason_num_rx_frame_stuck;
__le32 phy_warm_reset_reason_wal_rx_rec_rx_busy;
__le32 phy_warm_reset_reason_wal_rx_rec_mac_hng;
__le32 phy_warm_reset_reason_mac_conv_phy_reset;
__le32 wal_rx_recovery_rst_mac_hang_cnt;
__le32 wal_rx_recovery_rst_known_sig_cnt;
__le32 wal_rx_recovery_rst_no_rx_cnt;
__le32 wal_rx_recovery_rst_no_rx_consec_cnt;
__le32 wal_rx_recovery_rst_rx_busy_cnt;
__le32 wal_rx_recovery_rst_phy_mac_hang_cnt;
__le32 rx_flush_cnt;
__le32 phy_warm_reset_reason_tx_exp_cca_stuck;
__le32 phy_warm_reset_reason_tx_consec_flsh_war;
__le32 phy_warm_reset_reason_tx_hwsch_reset_war;
__le32 phy_warm_reset_reason_hwsch_cca_wdog_war;
__le32 fw_rx_rings_reset;
__le32 rx_dest_drain_rx_descs_leak_prevented;
__le32 rx_dest_drain_rx_descs_saved_cnt;
__le32 rx_dest_drain_rxdma2reo_leak_detected;
__le32 rx_dest_drain_rxdma2fw_leak_detected;
__le32 rx_dest_drain_rxdma2wbm_leak_detected;
__le32 rx_dest_drain_rxdma1_2sw_leak_detected;
__le32 rx_dest_drain_rx_drain_ok_mac_idle;
__le32 rx_dest_drain_ok_mac_not_idle;
__le32 rx_dest_drain_prerequisite_invld;
__le32 rx_dest_drain_skip_non_lmac_reset;
__le32 rx_dest_drain_hw_fifo_notempty_post_wait;
} __packed;
#define ATH12K_HTT_STATS_MAX_HW_INTR_NAME_LEN 8
struct ath12k_htt_hw_stats_intr_misc_tlv {
u8 hw_intr_name[ATH12K_HTT_STATS_MAX_HW_INTR_NAME_LEN];
__le32 mask;
__le32 count;
} __packed;
struct ath12k_htt_hw_stats_whal_tx_tlv {
__le32 mac_id__word;
__le32 last_unpause_ppdu_id;
__le32 hwsch_unpause_wait_tqm_write;
__le32 hwsch_dummy_tlv_skipped;
__le32 hwsch_misaligned_offset_received;
__le32 hwsch_reset_count;
__le32 hwsch_dev_reset_war;
__le32 hwsch_delayed_pause;
__le32 hwsch_long_delayed_pause;
__le32 sch_rx_ppdu_no_response;
__le32 sch_selfgen_response;
__le32 sch_rx_sifs_resp_trigger;
} __packed;
struct ath12k_htt_hw_war_stats_tlv {
__le32 mac_id__word;
DECLARE_FLEX_ARRAY(__le32, hw_wars);
} __packed;
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment