From: VolcomIlluminated <volcomilluminated@tuta.com>
To: Pkshih <pkshih@realtek.com>
Cc: Linux Wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH] rtw88: usb: retry control message on -EPROTO error
Date: Thu, 28 May 2026 22:02:55 +0200 (CEST) [thread overview]
Message-ID: <Otk9l6D--F-9@tuta.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 75 bytes --]
Patch Attached!
--
Secured with Tuta Mail:
https://tuta.com/free-email
[-- Attachment #1.2: Type: text/html, Size: 406 bytes --]
[-- Attachment #2: 0002-rtw88-usb-retry-on-EPROTO-error.patch --]
[-- Type: application/octet-stream, Size: 1462 bytes --]
From: VolcomIlluminated <volcomilluminated@tuta.com>
Date: Wed, 28 May 2026 00:00:00 +0000
Subject: [PATCH] rtw88: usb: retry control message on -EPROTO error
USB control messages can transiently fail with -EPROTO (-71) during
device probe on some USB host controllers. This manifests as repeated
"write register failed with -71" errors during driver initialization.
Add a retry loop of up to 3 attempts with 10ms delay when -EPROTO is
returned from usb_control_msg. This recovers the transient error and
allows the driver to initialize cleanly.
Tested on RTL8822BU (Edimax EW-7822ULC) with clean boot and zero
probe errors.
Signed-off-by: VolcomIlluminated <volcomilluminated@tuta.com>
---
--- /tmp/linux-6.18/drivers/net/wireless/realtek/rtw88/usb.c 2025-11-30 17:42:10.000000000 -0500
+++ /home/ptpx86mm1/kernelbuild/linux-6.18/drivers/net/wireless/realtek/rtw88/usb.c 2026-05-24 20:06:27.798337237 -0400
@@ -140,6 +140,16 @@
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
RTW_USB_CMD_REQ, RTW_USB_CMD_WRITE,
addr, 0, data, len, 500);
+ if (ret == -EPROTO) {
+ int retry;
+
+ for (retry = 0; retry < 3 && ret == -EPROTO; retry++) {
+ msleep(10);
+ ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
+ RTW_USB_CMD_REQ, RTW_USB_CMD_WRITE,
+ addr, 0, data, len, 500);
+ }
+ }
if (ret < 0 && ret != -ENODEV && count++ < 4)
rtw_err(rtwdev, "write register 0x%x failed with %d\n",
addr, ret);
next reply other threads:[~2026-05-28 20:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 20:02 VolcomIlluminated [this message]
2026-05-29 1:09 ` [PATCH] rtw88: usb: retry control message on -EPROTO error Ping-Ke Shih
2026-05-29 13:45 ` Bitterblue Smith
2026-06-01 1:27 ` 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=Otk9l6D--F-9@tuta.com \
--to=volcomilluminated@tuta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox