wifi: rtw89: fix inaccessible IO issues
Ping-Ke Shih
maintainercover wifi: rtw89: fix inaccessible IO issues
During debug, we found some inaccessible IO can cause that firmware detect hardware abnormal, and then trigger recovery mechanism. This make registers changed, and can't dump correct registers to reflect abnormal symptom for analysis.
Zong-Zhe Yang (2):
wifi: rtw89: debug: avoid invalid access on RTW89_DBG_SEL_MAC_30
wifi: rtw89: deal with RXI300 error
drivers/net/wireless/realtek/rtw89/debug.c | 7 +++++++ drivers/net/wireless/realtek/rtw89/mac.c | 5 ++++- drivers/net/wireless/realtek/rtw89/mac.h | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH 1/2 wifi: rtw89: debug: avoid invalid access on RTW89_DBG_SEL_MAC_30
From: Zong-Zhe Yang <[email protected]>
Only 8852C chip has valid pages on RTW89_DBG_SEL_MAC_30. To other chips, this section is an address hole. It will lead to crash if trying to access this section on chips except for 8852C. So, we avoid that.
--- drivers/net/wireless/realtek/rtw89/debug.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/wireless/realtek/rtw89/debug.c +7 -0
@@ -615,6 +615,7 @@ rtw89_debug_priv_mac_reg_dump_select(struct file *filp,struct seq_file *m = (struct seq_file *)filp->private_data;struct rtw89_debugfs_priv *debugfs_priv = m->private;struct rtw89_dev *rtwdev = debugfs_priv->rtwdev; +const struct rtw89_chip_info *chip = rtwdev->chip;char buf[32 ];size_t buf_size;int sel;
@@ -634,6 +635,12 @@ rtw89_debug_priv_mac_reg_dump_select(struct file *filp,return -EINVAL ; } +if (sel ==RTW89_DBG_SEL_MAC_30 && chip->chip_id !=RTL8852C ) { +rtw89_info (rtwdev,"sel %d is address hole on chip %d\n" , sel, + chip->chip_id); +return -EINVAL ; + } + debugfs_priv->cb_data = sel;rtw89_info (rtwdev,"select mac page dump %d\n" , debugfs_priv->cb_data);
Signature · 1 line
2.25.1
Re: [PATCH 1/2] wifi: rtw89: debug: avoid invalid access on RTW89_DBG_SEL_MAC_30
Quoted 8 lines · Ping-Ke Shih
From: Zong-Zhe Yang <[email protected]>
Only 8852C chip has valid pages on
RTW89_DBG_SEL_MAC_30. To other chips, this section is an address hole. It will lead to crash if trying to access this section on chips except for 8852C. So, we avoid that.Signed-off-by Zong-Zhe Yang <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>
2 patches applied to wireless-next.git, thanks.
c074da21dd34 wifi: rtw89: debug: avoid invalid access on RTW89_DBG_SEL_MAC_30 f5d98831badb wifi: rtw89: deal with RXI300 error
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Ping-Ke Shih
maintainerPATCH 2/2 wifi: rtw89: deal with RXI300 error
In reply to Ping-Ke ShihFrom: Zong-Zhe Yang <[email protected]>
RXI300 is a HW design to maintain stuffs across BUS, e.g. AXI, AHB, APB. It will feedback an error when host does an invalid BUS operation. For example,
* BUS master request without power/clock on.
* host reads/writes/accesses an invalid address.
They might lead to problems such as BUS timeout, platform hang, etc. So, once if RXI300 feedback an error, it notifies that driver need a L2 SER (system error recovery) to reset things.
Previously, driver did not parse the error scenario for RXI300. We add it and assign a corresponding error code which will make SER flow do L2 reset.
--- drivers/net/wireless/realtek/rtw89/mac.c | 5 ++++- drivers/net/wireless/realtek/rtw89/mac.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw89/mac.c +4 -1
@@ -623,7 +623,8 @@ static void rtw89_mac_dump_err_status(struct rtw89_dev *rtwdev,if (err !=MAC_AX_ERR_L1_ERR_DMAC && err !=MAC_AX_ERR_L0_PROMOTE_TO_L1 && err !=MAC_AX_ERR_L0_ERR_CMAC0 && - err !=MAC_AX_ERR_L0_ERR_CMAC1 ) + err !=MAC_AX_ERR_L0_ERR_CMAC1 && + err !=MAC_AX_ERR_RXI300 )return ;rtw89_info (rtwdev,"--->\nerr=0x%x\n" , err);
@@ -663,6 +664,8 @@ u32 rtw89_mac_get_err_status(struct rtw89_dev *rtwdev) err =MAC_AX_ERR_CPU_EXCEPTION ; else if (err_scnr == RTW89_WCPU_ASSERTION) err =MAC_AX_ERR_ASSERTION ; + else if (err_scnr == RTW89_RXI300_ERROR) + err =MAC_AX_ERR_RXI300 ;rtw89_fw_st_dbg_dump (rtwdev);rtw89_mac_dump_err_status (rtwdev, err);
drivers/net/wireless/realtek/rtw89/mac.h +2 -0
@@ -623,6 +623,7 @@ struct rtw89_mac_dle_dfi_qempty { };enum rtw89_mac_error_scenario { +RTW89_RXI300_ERROR =1 ,RTW89_WCPU_CPU_EXCEPTION =2 ,RTW89_WCPU_ASSERTION =3 , };
@@ -769,6 +770,7 @@ enum mac_ax_err_info {MAC_AX_ERR_L2_ERR_WDT_TIMEOUT_INT =0x2599 ,MAC_AX_ERR_CPU_EXCEPTION =0x3000 ,MAC_AX_ERR_ASSERTION =0x4000 , +MAC_AX_ERR_RXI300 =0x5000 ,MAC_AX_GET_ERR_MAX , MAC_AX_DUMP_SHAREBUFF_INDICATOR = 0x80000000,
Signature · 1 line
2.25.1