Commit 6f8d3655 authored by Chia-Yuan Li's avatar Chia-Yuan Li Committed by Kalle Valo

wifi: rtw89: 8922a: dump MAC registers when SER occurs

To diagnose the reason why firmware or hardware get abnormal, add to dump
MAC registers related to counters and interrupt masks. With these values,
people can classify problems and check if registers values are unexpected,
and then correct them. However, it could possible false alarm because
firmware triggers this SER event by wrong conditions that we should
correct it at firmware or register settings.

In field, SER might happen under special conditions, and very hard to
happen again, so dump lots of registers to provide rich information to
catch the problem.
Signed-off-by: default avatarChia-Yuan Li <leo.li@realtek.com>
Signed-off-by: default avatarZong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231204080751.15354-5-pkshih@realtek.com
parent eeb8cbb5
This diff is collapsed.
......@@ -935,6 +935,10 @@ struct rtw89_mac_gen_def {
enum rtw89_phy_idx phy_idx,
u32 reg_base, u32 *cr);
void (*dump_qta_lost)(struct rtw89_dev *rtwdev);
void (*dump_err_status)(struct rtw89_dev *rtwdev,
enum mac_ax_err_info err);
bool (*is_txq_empty)(struct rtw89_dev *rtwdev);
};
......@@ -1041,8 +1045,14 @@ int rtw89_mac_check_mac_en(struct rtw89_dev *rtwdev, u8 band,
enum rtw89_mac_hwmod_sel sel);
int rtw89_mac_write_lte(struct rtw89_dev *rtwdev, const u32 offset, u32 val);
int rtw89_mac_read_lte(struct rtw89_dev *rtwdev, const u32 offset, u32 *val);
int rtw89_mac_dle_dfi_cfg(struct rtw89_dev *rtwdev, struct rtw89_mac_dle_dfi_ctrl *ctrl);
int rtw89_mac_dle_dfi_quota_cfg(struct rtw89_dev *rtwdev,
struct rtw89_mac_dle_dfi_quota *quota);
void rtw89_mac_dump_dmac_err_status(struct rtw89_dev *rtwdev);
int rtw89_mac_dle_dfi_qempty_cfg(struct rtw89_dev *rtwdev,
struct rtw89_mac_dle_dfi_qempty *qempty);
void rtw89_mac_dump_l0_to_l1(struct rtw89_dev *rtwdev,
enum mac_ax_err_info err);
int rtw89_mac_add_vif(struct rtw89_dev *rtwdev, struct rtw89_vif *vif);
int rtw89_mac_port_update(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif);
void rtw89_mac_port_tsf_sync(struct rtw89_dev *rtwdev,
......
This diff is collapsed.
......@@ -3826,12 +3826,22 @@ static int rtw89_pci_ops_mac_lv1_recovery(struct rtw89_dev *rtwdev,
static void rtw89_pci_ops_dump_err_status(struct rtw89_dev *rtwdev)
{
rtw89_info(rtwdev, "R_AX_RPQ_RXBD_IDX =0x%08x\n",
rtw89_read32(rtwdev, R_AX_RPQ_RXBD_IDX));
rtw89_info(rtwdev, "R_AX_DBG_ERR_FLAG=0x%08x\n",
rtw89_read32(rtwdev, R_AX_DBG_ERR_FLAG));
rtw89_info(rtwdev, "R_AX_LBC_WATCHDOG=0x%08x\n",
rtw89_read32(rtwdev, R_AX_LBC_WATCHDOG));
if (rtwdev->chip->chip_gen == RTW89_CHIP_BE)
return;
if (rtwdev->chip->chip_id == RTL8852C) {
rtw89_info(rtwdev, "R_AX_DBG_ERR_FLAG=0x%08x\n",
rtw89_read32(rtwdev, R_AX_DBG_ERR_FLAG_V1));
rtw89_info(rtwdev, "R_AX_LBC_WATCHDOG=0x%08x\n",
rtw89_read32(rtwdev, R_AX_LBC_WATCHDOG_V1));
} else {
rtw89_info(rtwdev, "R_AX_RPQ_RXBD_IDX =0x%08x\n",
rtw89_read32(rtwdev, R_AX_RPQ_RXBD_IDX));
rtw89_info(rtwdev, "R_AX_DBG_ERR_FLAG=0x%08x\n",
rtw89_read32(rtwdev, R_AX_DBG_ERR_FLAG));
rtw89_info(rtwdev, "R_AX_LBC_WATCHDOG=0x%08x\n",
rtw89_read32(rtwdev, R_AX_LBC_WATCHDOG));
}
}
static int rtw89_pci_napi_poll(struct napi_struct *napi, int budget)
......
......@@ -812,6 +812,8 @@
#define B_AX_RXCOUNTER_MATCH_MASK GENMASK(15, 8)
#define B_AX_RXTIMER_MATCH_MASK GENMASK(7, 0)
#define R_AX_DBG_ERR_FLAG_V1 0x1104
#define R_AX_INT_MIT_RX_V1 0x1184
#define B_AX_RXMIT_RXP2_SEL_V1 BIT(19)
#define B_AX_RXMIT_RXP1_SEL_V1 BIT(18)
......@@ -857,6 +859,8 @@
#define R_AX_PCIE_HRPWM_V1 0x30C0
#define R_AX_PCIE_CRPWM 0x30C4
#define R_AX_LBC_WATCHDOG_V1 0x30D8
#define R_BE_PCIE_HRPWM 0x30C0
#define R_BE_PCIE_CRPWM 0x30C4
......
This diff is collapsed.
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