All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rtw-next 1/2] wifi: rtw89: Increase polling delay in rtw89_fw_read_c2h_reg() for USB
@ 2025-07-11 12:47 Bitterblue Smith
  2025-07-11 12:50 ` [PATCH rtw-next 2/2] wifi: rtw89: Increase polling delay in rtw89_fwdl_check_path_ready_* " Bitterblue Smith
  2025-07-14  2:49 ` [PATCH rtw-next 1/2] wifi: rtw89: Increase polling delay in rtw89_fw_read_c2h_reg() " Ping-Ke Shih
  0 siblings, 2 replies; 6+ messages in thread
From: Bitterblue Smith @ 2025-07-11 12:47 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

This read_poll_timeout_atomic() with a delay of 1 µs and a timeout of
1000000 µs can take ~250 seconds in the worst case because sending a
USB control message takes ~250 µs.

Increase the delay to 250 µs in order to reduce the maximum polling
time to ~2 seconds.

This problem was observed with RTL8851BU while suspending to RAM with
WOWLAN enabled. The computer sat for 4 minutes with a black screen
before suspending.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw89/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c
index c613431e754f..27d84464347b 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.c
+++ b/drivers/net/wireless/realtek/rtw89/fw.c
@@ -6665,7 +6665,7 @@ static int rtw89_fw_read_c2h_reg(struct rtw89_dev *rtwdev,
 
 	info->id = RTW89_FWCMD_C2HREG_FUNC_NULL;
 
-	ret = read_poll_timeout_atomic(rtw89_read8, val, val, 1,
+	ret = read_poll_timeout_atomic(rtw89_read8, val, val, 250,
 				       RTW89_C2H_TIMEOUT, false, rtwdev,
 				       chip->c2h_ctrl_reg);
 	if (ret) {
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-15 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11 12:47 [PATCH rtw-next 1/2] wifi: rtw89: Increase polling delay in rtw89_fw_read_c2h_reg() for USB Bitterblue Smith
2025-07-11 12:50 ` [PATCH rtw-next 2/2] wifi: rtw89: Increase polling delay in rtw89_fwdl_check_path_ready_* " Bitterblue Smith
2025-07-14  2:49 ` [PATCH rtw-next 1/2] wifi: rtw89: Increase polling delay in rtw89_fw_read_c2h_reg() " Ping-Ke Shih
2025-07-14 22:01   ` Bitterblue Smith
2025-07-15  0:28     ` Ping-Ke Shih
2025-07-15 10:07       ` Bitterblue Smith

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.