mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
patch: rtw88: sdio: fix incorrect RF path detection when MAC is powered off (#8587)
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: SuperKali <hello@superkali.me>
|
||||
Date: Sun, 7 Sep 2025 22:00:20 +0200
|
||||
Subject: rtw88: sdio: fix incorrect RF path detection when MAC is powered off
|
||||
|
||||
When reading REG_SYS_CFG1 register via direct I/O while MAC is powered off,
|
||||
incorrect values are returned (0x303030ea instead of 0x493d30ea), causing
|
||||
RTL8822CS to be incorrectly detected as 1T1R instead of 2T2R.
|
||||
|
||||
This leads to "unsupported rf path" errors and WiFi malfunction in 9 out of
|
||||
10 boots on some hardware configurations.
|
||||
|
||||
Fix by forcing indirect I/O when MAC is powered off and the address is not
|
||||
a bus address, ensuring correct register values are read during chip
|
||||
initialization.
|
||||
|
||||
Signed-off-by: SuperKali <hello@superkali.me>
|
||||
Link: https://lore.kernel.org/linux-wireless/7407FAA3-F4A4-48AA-91E5-A78DA711447D@gmail.com/
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/sdio.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
index 0cae5746f540..b054a73b50e0 100644
|
||||
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
@@ -141,12 +141,16 @@ static u32 rtw_sdio_to_io_address(struct rtw_dev *rtwdev, u32 addr,
|
||||
return rtw_sdio_to_bus_offset(rtwdev, addr);
|
||||
}
|
||||
|
||||
static bool rtw_sdio_use_direct_io(struct rtw_dev *rtwdev, u32 addr)
|
||||
{
|
||||
- return !rtw_sdio_is_sdio30_supported(rtwdev) ||
|
||||
- rtw_sdio_is_bus_addr(addr);
|
||||
+ if (!rtw_sdio_is_bus_addr(addr) &&
|
||||
+ !test_bit(RTW_FLAG_POWERON, rtwdev->flags))
|
||||
+ return false;
|
||||
+
|
||||
+ return !rtw_sdio_is_sdio30_supported(rtwdev) ||
|
||||
+ rtw_sdio_is_bus_addr(addr);
|
||||
}
|
||||
|
||||
static int rtw_sdio_indirect_reg_cfg(struct rtw_dev *rtwdev, u32 addr, u32 cfg)
|
||||
{
|
||||
struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
|
||||
--
|
||||
Armbian
|
||||
|
||||
Reference in New Issue
Block a user