mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
wifi: rtw89: debug: add ser_counters dbgfs
Dump counters of SER (system error recoery) L0/L1 related cases. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20251223030651.480633-8-pkshih@realtek.com
This commit is contained in:
parent
44ec302e02
commit
2ac399c5f5
|
|
@ -79,6 +79,7 @@ struct rtw89_debugfs {
|
|||
struct rtw89_debugfs_priv send_h2c;
|
||||
struct rtw89_debugfs_priv early_h2c;
|
||||
struct rtw89_debugfs_priv fw_crash;
|
||||
struct rtw89_debugfs_priv ser_counters;
|
||||
struct rtw89_debugfs_priv btc_info;
|
||||
struct rtw89_debugfs_priv btc_manual;
|
||||
struct rtw89_debugfs_priv fw_log_manual;
|
||||
|
|
@ -3680,6 +3681,60 @@ rtw89_debug_priv_fw_crash_set(struct rtw89_dev *rtwdev,
|
|||
return count;
|
||||
}
|
||||
|
||||
struct rtw89_dbg_ser_counters {
|
||||
unsigned int l0;
|
||||
unsigned int l1;
|
||||
unsigned int l0_to_l1;
|
||||
};
|
||||
|
||||
static void rtw89_dbg_get_ser_counters_ax(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_dbg_ser_counters *cnt)
|
||||
{
|
||||
const u32 val = rtw89_read32(rtwdev, R_AX_SER_DBG_INFO);
|
||||
|
||||
cnt->l0 = u32_get_bits(val, B_AX_SER_L0_COUNTER_MASK);
|
||||
cnt->l1 = u32_get_bits(val, B_AX_SER_L1_COUNTER_MASK);
|
||||
cnt->l0_to_l1 = u32_get_bits(val, B_AX_L0_TO_L1_EVENT_MASK);
|
||||
}
|
||||
|
||||
static void rtw89_dbg_get_ser_counters_be(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_dbg_ser_counters *cnt)
|
||||
{
|
||||
const u32 val = rtw89_read32(rtwdev, R_BE_SER_DBG_INFO);
|
||||
|
||||
cnt->l0 = u32_get_bits(val, B_BE_SER_L0_COUNTER_MASK);
|
||||
cnt->l1 = u32_get_bits(val, B_BE_SER_L1_COUNTER_MASK);
|
||||
cnt->l0_to_l1 = u32_get_bits(val, B_BE_SER_L0_PROMOTE_L1_EVENT_MASK);
|
||||
}
|
||||
|
||||
static ssize_t rtw89_debug_priv_ser_counters_get(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_debugfs_priv *debugfs_priv,
|
||||
char *buf, size_t bufsz)
|
||||
{
|
||||
const struct rtw89_chip_info *chip = rtwdev->chip;
|
||||
struct rtw89_dbg_ser_counters cnt = {};
|
||||
char *p = buf, *end = buf + bufsz;
|
||||
|
||||
rtw89_leave_ps_mode(rtwdev);
|
||||
|
||||
switch (chip->chip_gen) {
|
||||
case RTW89_CHIP_AX:
|
||||
rtw89_dbg_get_ser_counters_ax(rtwdev, &cnt);
|
||||
break;
|
||||
case RTW89_CHIP_BE:
|
||||
rtw89_dbg_get_ser_counters_be(rtwdev, &cnt);
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
p += scnprintf(p, end - p, "SER L0 Count: %d\n", cnt.l0);
|
||||
p += scnprintf(p, end - p, "SER L1 Count: %d\n", cnt.l1);
|
||||
p += scnprintf(p, end - p, "SER L0 promote event: %d\n", cnt.l0_to_l1);
|
||||
|
||||
return p - buf;
|
||||
}
|
||||
|
||||
static ssize_t rtw89_debug_priv_btc_info_get(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_debugfs_priv *debugfs_priv,
|
||||
char *buf, size_t bufsz)
|
||||
|
|
@ -4767,6 +4822,7 @@ static const struct rtw89_debugfs rtw89_debugfs_templ = {
|
|||
.send_h2c = rtw89_debug_priv_set(send_h2c),
|
||||
.early_h2c = rtw89_debug_priv_set_and_get(early_h2c, RWLOCK),
|
||||
.fw_crash = rtw89_debug_priv_set_and_get(fw_crash, WLOCK),
|
||||
.ser_counters = rtw89_debug_priv_get(ser_counters, RLOCK),
|
||||
.btc_info = rtw89_debug_priv_get(btc_info, RSIZE_12K),
|
||||
.btc_manual = rtw89_debug_priv_set(btc_manual),
|
||||
.fw_log_manual = rtw89_debug_priv_set(fw_log_manual, WLOCK),
|
||||
|
|
@ -4814,6 +4870,7 @@ void rtw89_debugfs_add_sec1(struct rtw89_dev *rtwdev, struct dentry *debugfs_top
|
|||
rtw89_debugfs_add_w(send_h2c);
|
||||
rtw89_debugfs_add_rw(early_h2c);
|
||||
rtw89_debugfs_add_rw(fw_crash);
|
||||
rtw89_debugfs_add_r(ser_counters);
|
||||
rtw89_debugfs_add_r(btc_info);
|
||||
rtw89_debugfs_add_w(btc_manual);
|
||||
rtw89_debugfs_add_w(fw_log_manual);
|
||||
|
|
|
|||
|
|
@ -607,6 +607,9 @@
|
|||
|
||||
#define R_AX_SER_DBG_INFO 0x8424
|
||||
#define B_AX_L0_TO_L1_EVENT_MASK GENMASK(31, 28)
|
||||
#define B_AX_SER_L1_COUNTER_MASK GENMASK(27, 24)
|
||||
#define B_AX_RMAC_PPDU_HANG_CNT_MASK GENMASK(23, 16)
|
||||
#define B_AX_SER_L0_COUNTER_MASK GENMASK(7, 0)
|
||||
|
||||
#define R_AX_DLE_EMPTY0 0x8430
|
||||
#define B_AX_PLE_EMPTY_QTA_DMAC_CPUIO BIT(26)
|
||||
|
|
@ -4731,7 +4734,7 @@
|
|||
#define B_BE_SER_L0_PROMOTE_L1_EVENT_MASK GENMASK(31, 28)
|
||||
#define B_BE_SER_L1_COUNTER_MASK GENMASK(27, 24)
|
||||
#define B_BE_RMAC_PPDU_HANG_CNT_MASK GENMASK(23, 16)
|
||||
#define B_BE_SER_L0_COUNTER_MASK GENMASK(8, 0)
|
||||
#define B_BE_SER_L0_COUNTER_MASK GENMASK(7, 0)
|
||||
|
||||
#define R_BE_DMAC_SYS_CR32B 0x842C
|
||||
#define B_BE_DMAC_BB_PHY1_MASK GENMASK(31, 16)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user