From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Subject: [PATCH rtw-next v2 08/14] wifi: rtw89: Hide some errors when the device is unplugged
Date: Mon, 9 Jun 2025 22:29:28 +0300 [thread overview]
Message-ID: <9f307332-928c-475e-9545-8dddcb33aa08@gmail.com> (raw)
In-Reply-To: <6fc81cc4-a4d1-4db9-ab60-c8976e0b3c27@gmail.com>
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>
---
v2:
- Add Acked-by.
---
drivers/net/wireless/realtek/rtw89/core.h | 1 +
drivers/net/wireless/realtek/rtw89/mac.c | 13 ++++++++-----
drivers/net/wireless/realtek/rtw89/phy.c | 3 ++-
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
index d4c7b47c3ba6..3f0ca65431ef 100644
--- a/drivers/net/wireless/realtek/rtw89/core.h
+++ b/drivers/net/wireless/realtek/rtw89/core.h
@@ -4927,6 +4927,7 @@ enum rtw89_flags {
RTW89_FLAG_FORBIDDEN_TRACK_WROK,
RTW89_FLAG_CHANGING_INTERFACE,
RTW89_FLAG_HW_RFKILL_STATE,
+ RTW89_FLAG_UNPLUGGED,
NUM_OF_RTW89_FLAGS,
};
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index 2cebde9e9229..875c1a3c5ca8 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -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);
@@ -5885,13 +5885,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;
}
@@ -6015,7 +6017,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;
}
diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
index 76a2e26d4a10..87dc88ea38c4 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.c
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
@@ -895,7 +895,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;
}
--
2.49.0
next prev parent reply other threads:[~2025-06-09 19:29 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 19:22 [PATCH rtw-next v2 00/14] wifi: rtw89: Add support for USB devices Bitterblue Smith
2025-06-09 19:23 ` [PATCH rtw-next v2 01/14] wifi: rtw89: 8851b: Accept USB devices and load their MAC address Bitterblue Smith
2025-06-09 19:24 ` [PATCH rtw-next v2 02/14] wifi: rtw89: Make dle_mem in rtw89_chip_info an array Bitterblue Smith
2025-06-16 1:15 ` Ping-Ke Shih
2025-06-09 19:25 ` [PATCH rtw-next v2 03/14] wifi: rtw89: Make hfc_param_ini " Bitterblue Smith
2025-06-16 1:26 ` Ping-Ke Shih
2025-06-16 16:55 ` Bitterblue Smith
2025-06-17 0:19 ` Ping-Ke Shih
2025-06-09 19:26 ` [PATCH rtw-next v2 04/14] wifi: rtw89: Add rtw8851b_dle_mem_usb{2,3} Bitterblue Smith
2025-06-16 1:28 ` Ping-Ke Shih
2025-06-09 19:27 ` [PATCH rtw-next v2 05/14] wifi: rtw89: Add rtw8851b_hfc_param_ini_usb Bitterblue Smith
2025-06-16 1:32 ` Ping-Ke Shih
2025-06-09 19:28 ` [PATCH rtw-next v2 06/14] wifi: rtw89: Disable deep power saving for USB/SDIO Bitterblue Smith
2025-06-16 1:42 ` Ping-Ke Shih
2025-06-18 11:05 ` Bitterblue Smith
2025-06-09 19:28 ` [PATCH rtw-next v2 07/14] wifi: rtw89: Add extra TX headroom for USB Bitterblue Smith
2025-06-09 19:29 ` Bitterblue Smith [this message]
2025-06-09 19:30 ` [PATCH rtw-next v2 09/14] wifi: rtw89: 8851b: Modify rtw8851b_pwr_{on,off}_func() " Bitterblue Smith
2025-06-10 14:11 ` kernel test robot
2025-06-16 1:51 ` Ping-Ke Shih
2025-06-18 13:53 ` Bitterblue Smith
2025-06-09 19:30 ` [PATCH rtw-next v2 10/14] wifi: rtw89: Fix rtw89_mac_power_switch() " Bitterblue Smith
2025-06-16 2:21 ` Ping-Ke Shih
2025-06-16 9:14 ` Ping-Ke Shih
2025-06-09 19:31 ` [PATCH rtw-next v2 11/14] wifi: rtw89: Add some definitions " Bitterblue Smith
2025-06-09 19:32 ` [PATCH rtw-next v2 12/14] wifi: rtw89: Add usb.{c,h} Bitterblue Smith
2025-06-16 3:10 ` Ping-Ke Shih
2025-06-18 11:06 ` Bitterblue Smith
2025-06-09 19:33 ` [PATCH rtw-next v2 13/14] wifi: rtw89: Add rtw8851bu.c Bitterblue Smith
2025-06-16 3:11 ` Ping-Ke Shih
2025-06-09 19:34 ` [PATCH rtw-next v2 14/14] wifi: rtw89: Enable the new USB modules Bitterblue Smith
2025-06-10 11:55 ` kernel test robot
2025-06-10 13:33 ` Bitterblue Smith
2025-06-11 0:32 ` Ping-Ke Shih
2025-06-11 0:33 ` Ping-Ke Shih
2025-06-11 12:37 ` Bitterblue Smith
2025-06-12 1:27 ` Ping-Ke Shih
2025-06-16 3:15 ` Ping-Ke Shih
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9f307332-928c-475e-9545-8dddcb33aa08@gmail.com \
--to=rtl8821cerfe2@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.