]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: retry efuse physical map dump on transient failure
authorChristian Hewitt <christianshewitt@gmail.com>
Tue, 17 Mar 2026 11:21:55 +0000 (11:21 +0000)
committerPing-Ke Shih <pkshih@realtek.com>
Mon, 30 Mar 2026 01:43:51 +0000 (09:43 +0800)
On Radxa Rock 5B with a RTL8852BE combo WiFi/BT card, the efuse
physical map dump intermittently fails with -EBUSY during probe.
The failure occurs in rtw89_dump_physical_efuse_map_ddv() where
read_poll_timeout_atomic() times out waiting for the B_AX_EF_RDY
bit after 1 second.

The root cause is a timing race during boot: the WiFi driver's
chip initialization (firmware download via PCIe) overlaps with
Bluetooth firmware download to the same combo chip via USB. This
can leave the efuse controller temporarily unavailable when the
WiFi driver attempts to read the efuse map.

The firmware download path retries up to 5 times, but the efuse
read that follows has no similar logic. Address this by adding
retry loop logic (also up to 5 attempts) around physical efuse
map dump.

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260317112155.1939569-1-christianshewitt@gmail.com
drivers/net/wireless/realtek/rtw89/efuse.c

index a2757a88d55da575026678523f0b9e3477931c30..89d4b1b865f8ff6f6a9686e636ef51733740ff7f 100644 (file)
@@ -185,8 +185,8 @@ static int rtw89_dump_physical_efuse_map_dav(struct rtw89_dev *rtwdev, u8 *map,
        return 0;
 }
 
-static int rtw89_dump_physical_efuse_map(struct rtw89_dev *rtwdev, u8 *map,
-                                        u32 dump_addr, u32 dump_size, bool dav)
+static int __rtw89_dump_physical_efuse_map(struct rtw89_dev *rtwdev, u8 *map,
+                                          u32 dump_addr, u32 dump_size, bool dav)
 {
        int ret;
 
@@ -208,6 +208,25 @@ static int rtw89_dump_physical_efuse_map(struct rtw89_dev *rtwdev, u8 *map,
        return 0;
 }
 
+static int rtw89_dump_physical_efuse_map(struct rtw89_dev *rtwdev, u8 *map,
+                                        u32 dump_addr, u32 dump_size, bool dav)
+{
+       int retry;
+       int ret;
+
+       for (retry = 0; retry < 5; retry++) {
+               ret = __rtw89_dump_physical_efuse_map(rtwdev, map, dump_addr,
+                                                     dump_size, dav);
+               if (!ret)
+                       return 0;
+
+               rtw89_warn(rtwdev, "efuse dump (dav=%d) failed, retrying (%d)\n",
+                          dav, retry);
+       }
+
+       return ret;
+}
+
 #define invalid_efuse_header(hdr1, hdr2) \
        ((hdr1) == 0xff || (hdr2) == 0xff)
 #define invalid_efuse_content(word_en, i) \