mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 05:39:42 -04:00
wifi: rtw89: Hide some errors when the device is unplugged
A few unnecessary error messages are printed when the device is unplugged. "read swsi busy" in particular can appear ~1000 times when RTL8851BU is unplugged. Add a new flag RTW89_FLAG_UNPLUGGED and print some error messages only when this flag is not set. The new USB driver will set the flag when the device is unplugged. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/cc18b739-6f38-4c1a-a681-1e2a0d4ed60d@gmail.com
This commit is contained in:
committed by
Ping-Ke Shih
parent
ec542d5e4b
commit
0740c6beef
@@ -4995,6 +4995,7 @@ enum rtw89_flags {
|
||||
RTW89_FLAG_FORBIDDEN_TRACK_WORK,
|
||||
RTW89_FLAG_CHANGING_INTERFACE,
|
||||
RTW89_FLAG_HW_RFKILL_STATE,
|
||||
RTW89_FLAG_UNPLUGGED,
|
||||
|
||||
NUM_OF_RTW89_FLAGS,
|
||||
};
|
||||
|
||||
@@ -88,7 +88,7 @@ int rtw89_mac_write_lte(struct rtw89_dev *rtwdev, const u32 offset, u32 val)
|
||||
|
||||
ret = read_poll_timeout(rtw89_read8, lte_ctrl, (lte_ctrl & BIT(5)) != 0,
|
||||
50, 50000, false, rtwdev, R_AX_LTE_CTRL + 3);
|
||||
if (ret)
|
||||
if (ret && !test_bit(RTW89_FLAG_UNPLUGGED, rtwdev->flags))
|
||||
rtw89_err(rtwdev, "[ERR]lte not ready(W)\n");
|
||||
|
||||
rtw89_write32(rtwdev, R_AX_LTE_WDATA, val);
|
||||
@@ -104,7 +104,7 @@ int rtw89_mac_read_lte(struct rtw89_dev *rtwdev, const u32 offset, u32 *val)
|
||||
|
||||
ret = read_poll_timeout(rtw89_read8, lte_ctrl, (lte_ctrl & BIT(5)) != 0,
|
||||
50, 50000, false, rtwdev, R_AX_LTE_CTRL + 3);
|
||||
if (ret)
|
||||
if (ret && !test_bit(RTW89_FLAG_UNPLUGGED, rtwdev->flags))
|
||||
rtw89_err(rtwdev, "[ERR]lte not ready(W)\n");
|
||||
|
||||
rtw89_write32(rtwdev, R_AX_LTE_CTRL, 0x800F0000 | offset);
|
||||
@@ -5922,13 +5922,15 @@ int rtw89_mac_coex_init(struct rtw89_dev *rtwdev, const struct rtw89_mac_ax_coex
|
||||
|
||||
ret = rtw89_mac_read_lte(rtwdev, R_AX_LTE_SW_CFG_2, &val32);
|
||||
if (ret) {
|
||||
rtw89_err(rtwdev, "Read R_AX_LTE_SW_CFG_2 fail!\n");
|
||||
if (!test_bit(RTW89_FLAG_UNPLUGGED, rtwdev->flags))
|
||||
rtw89_err(rtwdev, "Read R_AX_LTE_SW_CFG_2 fail!\n");
|
||||
return ret;
|
||||
}
|
||||
val32 = val32 & B_AX_WL_RX_CTRL;
|
||||
ret = rtw89_mac_write_lte(rtwdev, R_AX_LTE_SW_CFG_2, val32);
|
||||
if (ret) {
|
||||
rtw89_err(rtwdev, "Write R_AX_LTE_SW_CFG_2 fail!\n");
|
||||
if (!test_bit(RTW89_FLAG_UNPLUGGED, rtwdev->flags))
|
||||
rtw89_err(rtwdev, "Write R_AX_LTE_SW_CFG_2 fail!\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -6052,7 +6054,8 @@ int rtw89_mac_cfg_gnt(struct rtw89_dev *rtwdev,
|
||||
|
||||
ret = rtw89_mac_write_lte(rtwdev, R_AX_LTE_SW_CFG_1, val);
|
||||
if (ret) {
|
||||
rtw89_err(rtwdev, "Write LTE fail!\n");
|
||||
if (!test_bit(RTW89_FLAG_UNPLUGGED, rtwdev->flags))
|
||||
rtw89_err(rtwdev, "Write LTE fail!\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -897,7 +897,8 @@ static u32 rtw89_phy_read_rf_a(struct rtw89_dev *rtwdev,
|
||||
30, false, rtwdev, R_SWSI_V1,
|
||||
B_SWSI_R_DATA_DONE_V1);
|
||||
if (ret) {
|
||||
rtw89_err(rtwdev, "read swsi busy\n");
|
||||
if (!test_bit(RTW89_FLAG_UNPLUGGED, rtwdev->flags))
|
||||
rtw89_err(rtwdev, "read swsi busy\n");
|
||||
return INV_RF_DATA;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user