diff mbox series

[SRU,N,v2,1/1] wifi: rtw89: 885xb: reset IDMEM mode to prevent download firmware failure

Message ID 20240828064555.232026-2-en-wei.wu@canonical.com
State New
Headers show
Series [SRU,N,v2,1/1] wifi: rtw89: 885xb: reset IDMEM mode to prevent download firmware failure | expand

Commit Message

En-Wei Wu Aug. 28, 2024, 6:45 a.m. UTC
From: Ping-Ke Shih <pkshih@realtek.com>

BugLink: https://bugs.launchpad.net/bugs/2077396

For different firmware type, it could change IDMEM mode, so reset it to
default to avoid encountering error for RTL8851B/RTL8852B/RTL8852BT
if that kind of firmware was downloaded before.

    rtw89_8851be 0000:02:00.0: Firmware version 0.29.41.3, cmd version 0, type 5
    rtw89_8851be 0000:02:00.0: Firmware version 0.29.41.3, cmd version 0, type 3
    rtw89_8851be 0000:02:00.0: MAC has already powered on
    rtw89_8851be 0000:02:00.0: fw security fail
    rtw89_8851be 0000:02:00.0: download firmware fail
    rtw89_8851be 0000:02:00.0: [ERR]fwdl 0x1E0 = 0x62
    rtw89_8851be 0000:02:00.0: [ERR]fwdl 0x83F2 = 0x8
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f51c
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f524
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f51c
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f500
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f51c
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f53c
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f520
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f520
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f508
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f534
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f520
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f534
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f508
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f53c
    rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f524
    rtw89_8851be 0000:02:00.0: failed to setup chip information
    rtw89_8851be: probe of 0000:02:00.0 failed with error -16

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240724052626.12774-4-pkshih@realtek.com
(backported from commit 80fb81bb46a57daedd5decbcc253ea48428a254e linux-next)
Signed-off-by: En-Wei Wu <en-wei.wu@canonical.com>
---
 drivers/net/wireless/realtek/rtw89/core.h | 1 +
 drivers/net/wireless/realtek/rtw89/mac.c  | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Kuan-Ying Lee Sept. 5, 2024, 8:41 a.m. UTC | #1
On Wed, Aug 28, 2024 at 02:45:53PM +0800, En-Wei Wu wrote:
> From: Ping-Ke Shih <pkshih@realtek.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/2077396
> 
> For different firmware type, it could change IDMEM mode, so reset it to
> default to avoid encountering error for RTL8851B/RTL8852B/RTL8852BT
> if that kind of firmware was downloaded before.
> 
>     rtw89_8851be 0000:02:00.0: Firmware version 0.29.41.3, cmd version 0, type 5
>     rtw89_8851be 0000:02:00.0: Firmware version 0.29.41.3, cmd version 0, type 3
>     rtw89_8851be 0000:02:00.0: MAC has already powered on
>     rtw89_8851be 0000:02:00.0: fw security fail
>     rtw89_8851be 0000:02:00.0: download firmware fail
>     rtw89_8851be 0000:02:00.0: [ERR]fwdl 0x1E0 = 0x62
>     rtw89_8851be 0000:02:00.0: [ERR]fwdl 0x83F2 = 0x8
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f51c
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f524
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f51c
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f500
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f51c
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f53c
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f520
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f520
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f508
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f534
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f520
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f534
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f508
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f53c
>     rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f524
>     rtw89_8851be 0000:02:00.0: failed to setup chip information
>     rtw89_8851be: probe of 0000:02:00.0 failed with error -16
> 
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> Link: https://patch.msgid.link/20240724052626.12774-4-pkshih@realtek.com
> (backported from commit 80fb81bb46a57daedd5decbcc253ea48428a254e linux-next)

For backported patch, there must be a brief explanation after 
the above line, between square brackets, with the name of
the person who introduced the change.

Thanks,
Kuan-Ying Lee

> Signed-off-by: En-Wei Wu <en-wei.wu@canonical.com>
> ---
>  drivers/net/wireless/realtek/rtw89/core.h | 1 +
>  drivers/net/wireless/realtek/rtw89/mac.c  | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
> index 82d7a2dd88b0..e48c4c7e4bda 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.h
> +++ b/drivers/net/wireless/realtek/rtw89/core.h
> @@ -129,6 +129,7 @@ enum rtw89_hci_type {
>  enum rtw89_core_chip_id {
>  	RTL8852A,
>  	RTL8852B,
> +	RTL8852BT,
>  	RTL8852C,
>  	RTL8851B,
>  	RTL8922A,
> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
> index c485ef2cc3d3..4c3a2083110f 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
> @@ -3739,7 +3739,9 @@ static int rtw89_mac_enable_cpu_ax(struct rtw89_dev *rtwdev, u8 boot_reason,
>  
>  	rtw89_write32(rtwdev, R_AX_WCPU_FW_CTRL, val);
>  
> -	if (rtwdev->chip->chip_id == RTL8852B)
> +	if (rtwdev->chip->chip_id == RTL8852B ||
> +	    rtwdev->chip->chip_id == RTL8851B ||
> +	    rtwdev->chip->chip_id == RTL8852BT)
>  		rtw89_write32_mask(rtwdev, R_AX_SEC_CTRL,
>  				   B_AX_SEC_IDMEM_SIZE_CONFIG_MASK, 0x2);
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
index 82d7a2dd88b0..e48c4c7e4bda 100644
--- a/drivers/net/wireless/realtek/rtw89/core.h
+++ b/drivers/net/wireless/realtek/rtw89/core.h
@@ -129,6 +129,7 @@  enum rtw89_hci_type {
 enum rtw89_core_chip_id {
 	RTL8852A,
 	RTL8852B,
+	RTL8852BT,
 	RTL8852C,
 	RTL8851B,
 	RTL8922A,
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index c485ef2cc3d3..4c3a2083110f 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -3739,7 +3739,9 @@  static int rtw89_mac_enable_cpu_ax(struct rtw89_dev *rtwdev, u8 boot_reason,
 
 	rtw89_write32(rtwdev, R_AX_WCPU_FW_CTRL, val);
 
-	if (rtwdev->chip->chip_id == RTL8852B)
+	if (rtwdev->chip->chip_id == RTL8852B ||
+	    rtwdev->chip->chip_id == RTL8851B ||
+	    rtwdev->chip->chip_id == RTL8852BT)
 		rtw89_write32_mask(rtwdev, R_AX_SEC_CTRL,
 				   B_AX_SEC_IDMEM_SIZE_CONFIG_MASK, 0x2);