Skip to contentSkip to conversation

wifi: rtw88: sdio: use indirect IO for device registers before power-on

PATCH In review Ping-Ke Shih 3 participants 8 messages Jul 24, 2025 – Nov 25, 2025

Subsystems (3)
lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 wifi: rtw88: sdio: use indirect IO for device registers before power-on

The register REG_SYS_CFG1 is used to determine chip basic information as arguments of following flows, such as download firmware and load PHY parameters, so driver read the value early (before power-on).

However, the direct IO is disallowed before power-on, or it causes wrong values, which driver recognizes a chip as a wrong type RF_1T1R, but actually RF_2T2R, causing driver warns:

rtw88_8822cs mmc1:0001:1: unsupported rf path (1)

Fix it by using indirect IO before power-on.

---
 drivers/net/wireless/realtek/rtw88/sdio.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/realtek/rtw88/sdio.c +4 -0
index cc2d4fef3587..99d7c629eac6 100644
@@ -144,6 +144,10 @@ static u32 rtw_sdio_to_io_address(struct rtw_dev *rtwdev, u32 addr,
 
 static bool rtw_sdio_use_direct_io(struct rtw_dev *rtwdev, u32 addr)
 {
+	if (!test_bit(RTW_FLAG_POWERON, rtwdev->flags) &&
+	    !rtw_sdio_is_bus_addr(addr))
+		return false;
+
 	return !rtw_sdio_is_sdio30_supported(rtwdev) ||
 		rtw_sdio_is_bus_addr(addr);
 }
Signature · 1 line
2.25.1
author maintainer Tested-by Piotr Oniszczuk on v1 1/1
#1 lore raw
Quoted 8 lines · Ping-Ke Shih

The register REG_SYS_CFG1 is used to determine chip basic information as arguments of following flows, such as download firmware and load PHY parameters, so driver read the value early (before power-on).

However, the direct IO is disallowed before power-on, or it causes wrong values, which driver recognizes a chip as a wrong type RF_1T1R, but actually RF_2T2R, causing driver warns:

Quoted 8 lines

rtw88_8822cs mmc1:0001:1: unsupported rf path (1)

Fix it by using indirect IO before power-on.

Pick from [1] & remove mailto:

[1] https://lore.kernel.org/linux-wireless/[email protected]/T/#m5af73c4f7f35f16071392f395ebec10e36d39128

Quoted 22 lines
---
 drivers/net/wireless/realtek/rtw88/sdio.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/realtek/rtw88/sdio.c +4 -1
index cc2d4fef3587..99d7c629eac6 100644
@@ -144,6 +144,10 @@ static u32 rtw_sdio_to_io_address(struct rtw_dev *rtwdev, u32 addr,
 
 static bool rtw_sdio_use_direct_io(struct rtw_dev *rtwdev, u32 addr)
 {
+	if (!test_bit(RTW_FLAG_POWERON, rtwdev->flags) &&
+	    !rtw_sdio_is_bus_addr(addr))
+		return false;
+
 	return !rtw_sdio_is_sdio30_supported(rtwdev) ||
 		rtw_sdio_is_bus_addr(addr);
 }
--

2.25.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Ping-Ke Shih
Quoted 8 lines

The register REG_SYS_CFG1 is used to determine chip basic information as arguments of following flows, such as download firmware and load PHY parameters, so driver read the value early (before power-on).

However, the direct IO is disallowed before power-on, or it causes wrong values, which driver recognizes a chip as a wrong type RF_1T1R, but actually RF_2T2R, causing driver warns:

Quoted 8 lines

rtw88_8822cs mmc1:0001:1: unsupported rf path (1)

Fix it by using indirect IO before power-on.

Thanks for finding and fixing this!
The fix looks correct since indirect access (according to the vendor driver) is needed for both reads and writes (which is what the approach from this patch achives).

author maintainer
#3 lore raw
In reply to Ping-Ke Shih
Quoted 10 lines · Ping-Ke Shih

The register REG_SYS_CFG1 is used to determine chip basic information as arguments of following flows, such as download firmware and load PHY parameters, so driver read the value early (before power-on).

However, the direct IO is disallowed before power-on, or it causes wrong values, which driver recognizes a chip as a wrong type RF_1T1R, but actually RF_2T2R, causing driver warns:

rtw88_8822cs mmc1:0001:1: unsupported rf path (1)

Quoted 8 lines

Fix it by using indirect IO before power-on.

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

58de1f91e033 wifi: rtw88: sdio: use indirect IO for device registers before power-on

---
https://github.com/pkshih/rtw.git

#4 lore raw
In reply to Ping-Ke Shih

Hi,

This patch was recently backported to stable kernels (v6.12.58) and it broke wlan on PinePhone, that uses 8723cs SDIO chip. The same problem appears of course on latest 6.18-rc6. Reverting this change resolves the problem.

```
$ sudo dmesg | grep -i rtw88
[   24.940551] rtw88_8723cs mmc1:0001:1: WOW Firmware version 11.0.0, H2C version 0
[   24.953085] rtw88_8723cs mmc1:0001:1: Firmware version 11.0.0, H2C version 0
[   24.955892] rtw88_8723cs mmc1:0001:1: sdio read32 failed (0xf0): -110
[   24.973135] rtw88_8723cs mmc1:0001:1: sdio write8 failed (0x1c): -110
[   24.980673] rtw88_8723cs mmc1:0001:1: sdio read32 failed (0xf0): -110
...
[   25.446691] rtw88_8723cs mmc1:0001:1: sdio read8 failed (0x100): -110
[   25.453569] rtw88_8723cs mmc1:0001:1: mac power on failed
[   25.459077] rtw88_8723cs mmc1:0001:1: failed to power on mac
[   25.464841] rtw88_8723cs mmc1:0001:1: failed to setup chip efuse info
[   25.464856] rtw88_8723cs mmc1:0001:1: failed to setup chip information
[   25.478341] rtw88_8723cs mmc1:0001:1: probe with driver rtw88_8723cs failed with error -114
```
Quoted 38 lines · Ping-Ke Shih

The register REG_SYS_CFG1 is used to determine chip basic information as arguments of following flows, such as download firmware and load PHY parameters, so driver read the value early (before power-on).

However, the direct IO is disallowed before power-on, or it causes wrong values, which driver recognizes a chip as a wrong type RF_1T1R, but actually RF_2T2R, causing driver warns:

rtw88_8822cs mmc1:0001:1: unsupported rf path (1)

Fix it by using indirect IO before power-on.

---
 drivers/net/wireless/realtek/rtw88/sdio.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/realtek/rtw88/sdio.c +4 -0
index cc2d4fef3587..99d7c629eac6 100644
@@ -144,6 +144,10 @@ static u32 rtw_sdio_to_io_address(struct rtw_dev *rtwdev, u32 addr,
 
 static bool rtw_sdio_use_direct_io(struct rtw_dev *rtwdev, u32 addr)
 {
+	if (!test_bit(RTW_FLAG_POWERON, rtwdev->flags) &&
+	    !rtw_sdio_is_bus_addr(addr))
+		return false;
+
 	return !rtw_sdio_is_sdio30_supported(rtwdev) ||
 		rtw_sdio_is_bus_addr(addr);
 }
Signature · 1 line
2.25.1
Signature · 2 lines
Best regards,
Andrey Skvortsov
author maintainer
#5 lore raw
Quoted 7 lines · Andrey Skvortsov

Hi,

This patch was recently backported to stable kernels (v6.12.58) and it broke wlan on PinePhone, that uses 8723cs SDIO chip. The same problem appears of course on latest 6.18-rc6. Reverting this change resolves the problem.

Quoted 16 lines
```
$ sudo dmesg | grep -i rtw88
[   24.940551] rtw88_8723cs mmc1:0001:1: WOW Firmware version 11.0.0, H2C version 0
[   24.953085] rtw88_8723cs mmc1:0001:1: Firmware version 11.0.0, H2C version 0
[   24.955892] rtw88_8723cs mmc1:0001:1: sdio read32 failed (0xf0): -110
[   24.973135] rtw88_8723cs mmc1:0001:1: sdio write8 failed (0x1c): -110
[   24.980673] rtw88_8723cs mmc1:0001:1: sdio read32 failed (0xf0): -110
...
[   25.446691] rtw88_8723cs mmc1:0001:1: sdio read8 failed (0x100): -110
[   25.453569] rtw88_8723cs mmc1:0001:1: mac power on failed
[   25.459077] rtw88_8723cs mmc1:0001:1: failed to power on mac
[   25.464841] rtw88_8723cs mmc1:0001:1: failed to setup chip efuse info
[   25.464856] rtw88_8723cs mmc1:0001:1: failed to setup chip information
[   25.478341] rtw88_8723cs mmc1:0001:1: probe with driver rtw88_8723cs failed with error -114
```

Check original link of this patch [1] that 8822cs read incorrect from 0xf0 resulting in "rtw88_8822cs mmc1:0001:1: unsupported rf path (1)".

I wonder if we can add additional checking rule of chip ID, like:

drivers/net/wireless/realtek/rtw88/sdio.c +3 -1
@@ -144,8 +144,10 @@ static u32 rtw_sdio_to_io_address(struct rtw_dev *rtwdev, u32 addr,
 
 static bool rtw_sdio_use_direct_io(struct rtw_dev *rtwdev, u32 addr)
 {
+       bool might_indirect_under_power_off = rtwdev->chip->id != RTW_CHIP_TYPE_8703B;
+
        if (!test_bit(RTW_FLAG_POWERON, rtwdev->flags) &&
-           !rtw_sdio_is_bus_addr(addr))
+           !rtw_sdio_is_bus_addr(addr) && might_indirect_under_power_off)
                return false;
 
        return !rtw_sdio_is_sdio30_supported(rtwdev) ||

[1] https://lore.kernel.org/linux-wireless/[email protected]/T/#t

#6 lore raw
Quoted 8 lines · Ping-Ke Shih
Quoted 7 lines · Andrey Skvortsov

Hi,

This patch was recently backported to stable kernels (v6.12.58) and it broke wlan on PinePhone, that uses 8723cs SDIO chip. The same problem appears of course on latest 6.18-rc6. Reverting this change resolves the problem.

Quoted 5 lines
Quoted 5 lines

```

$ sudo dmesg | grep -i rtw88
[   24.940551] rtw88_8723cs mmc1:0001:1: WOW Firmware version 11.0.0, H2C version 0
[   24.953085] rtw88_8723cs mmc1:0001:1: Firmware version 11.0.0, H2C version 0
[   24.955892] rtw88_8723cs mmc1:0001:1: sdio read32 failed (0xf0): -110

I see it fails with timeout on the first operation to read chip version.

Quoted 12 lines
Quoted 11 lines
[   24.973135] rtw88_8723cs mmc1:0001:1: sdio write8 failed (0x1c): -110
[   24.980673] rtw88_8723cs mmc1:0001:1: sdio read32 failed (0xf0): -110
...
[   25.446691] rtw88_8723cs mmc1:0001:1: sdio read8 failed (0x100): -110
[   25.453569] rtw88_8723cs mmc1:0001:1: mac power on failed
[   25.459077] rtw88_8723cs mmc1:0001:1: failed to power on mac
[   25.464841] rtw88_8723cs mmc1:0001:1: failed to setup chip efuse info
[   25.464856] rtw88_8723cs mmc1:0001:1: failed to setup chip information
[   25.478341] rtw88_8723cs mmc1:0001:1: probe with driver rtw88_8723cs failed with error -114

```

Quoted 2 lines

Check original link of this patch [1] that 8822cs read incorrect from 0xf0 resulting in "rtw88_8822cs mmc1:0001:1: unsupported rf path (1)".

Sorry, I haven't meant, that this patch should be reverted. I see, that it solves real problem. I've meant, that patch caused this regression was identified and it was confirmed by reverting it.

Quoted 1 line

I wonder if we can add additional checking rule of chip ID, like:

I've tried suggested change and wlan is recognized again.

Quoted 18 lines
drivers/net/wireless/realtek/rtw88/sdio.c +3 -1
@@ -144,8 +144,10 @@ static u32 rtw_sdio_to_io_address(struct rtw_dev *rtwdev, u32 addr,
 
 static bool rtw_sdio_use_direct_io(struct rtw_dev *rtwdev, u32 addr)
 {
+       bool might_indirect_under_power_off = rtwdev->chip->id != RTW_CHIP_TYPE_8703B;
+
        if (!test_bit(RTW_FLAG_POWERON, rtwdev->flags) &&
-           !rtw_sdio_is_bus_addr(addr))
+           !rtw_sdio_is_bus_addr(addr) && might_indirect_under_power_off)
                return false;
 
        return !rtw_sdio_is_sdio30_supported(rtwdev) ||

[1] https://lore.kernel.org/linux-wireless/[email protected]/T/#t

Signature · 2 lines
Best regards,
Andrey Skvortsov
author maintainer
#7 lore raw
Quoted 28 lines · Andrey Skvortsov
Quoted 8 lines · Ping-Ke Shih
Quoted 7 lines · Andrey Skvortsov

Hi,

This patch was recently backported to stable kernels (v6.12.58) and it broke wlan on PinePhone, that uses 8723cs SDIO chip. The same problem appears of course on latest 6.18-rc6. Reverting this change resolves the problem.

Quoted 5 lines
Quoted 5 lines

```

$ sudo dmesg | grep -i rtw88
[   24.940551] rtw88_8723cs mmc1:0001:1: WOW Firmware version 11.0.0, H2C version 0
[   24.953085] rtw88_8723cs mmc1:0001:1: Firmware version 11.0.0, H2C version 0
[   24.955892] rtw88_8723cs mmc1:0001:1: sdio read32 failed (0xf0): -110

I see it fails with timeout on the first operation to read chip version.

Quoted 12 lines
Quoted 11 lines
[   24.973135] rtw88_8723cs mmc1:0001:1: sdio write8 failed (0x1c): -110
[   24.980673] rtw88_8723cs mmc1:0001:1: sdio read32 failed (0xf0): -110
...
[   25.446691] rtw88_8723cs mmc1:0001:1: sdio read8 failed (0x100): -110
[   25.453569] rtw88_8723cs mmc1:0001:1: mac power on failed
[   25.459077] rtw88_8723cs mmc1:0001:1: failed to power on mac
[   25.464841] rtw88_8723cs mmc1:0001:1: failed to setup chip efuse info
[   25.464856] rtw88_8723cs mmc1:0001:1: failed to setup chip information
[   25.478341] rtw88_8723cs mmc1:0001:1: probe with driver rtw88_8723cs failed with error -114

```

Quoted 5 lines
Quoted 2 lines

Check original link of this patch [1] that 8822cs read incorrect from 0xf0 resulting in "rtw88_8822cs mmc1:0001:1: unsupported rf path (1)".

Sorry, I haven't meant, that this patch should be reverted. I see, that it solves real problem. I've meant, that patch caused this regression was identified and it was confirmed by reverting it.

I just want to point out the original problem we encountered, and the user weirdly get unexpected value from 0xF0 without any error.

Quoted 5 lines
Quoted 2 lines

I wonder if we can add additional checking rule of chip ID, like:

I've tried suggested change and wlan is recognized again.

I will check if vendor driver does similar things, and then I can make a formal patch for 8723CS.