public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw88: 8821cu: Fix connection failure
       [not found] <f12ed39d-28e8-4b8b-8d22-447bcf295afc@gmail.com>
@ 2024-03-23 16:18 ` Bitterblue Smith
  2024-03-23 16:23   ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Bitterblue Smith @ 2024-03-23 16:18 UTC (permalink / raw)
  To: stable

From: Bitterblue Smith <rtl8821cerfe2@gmail.com>

[ Upstream commit 605d7c0b05eecb985273b1647070497142c470d3 ]

Clear bit 8 of REG_SYS_STATUS1 after MAC power on.

Without this, some RTL8821CU and RTL8811CU cannot connect to any
network:

Feb 19 13:33:11 ideapad2 kernel: wlp3s0f3u2: send auth to
	90:55:de:__:__:__ (try 1/3)
Feb 19 13:33:13 ideapad2 kernel: wlp3s0f3u2: send auth to
	90:55:de:__:__:__ (try 2/3)
Feb 19 13:33:14 ideapad2 kernel: wlp3s0f3u2: send auth to
	90:55:de:__:__:__ (try 3/3)
Feb 19 13:33:15 ideapad2 kernel: wlp3s0f3u2: authentication with
	90:55:de:__:__:__ timed out

The RTL8822CU and RTL8822BU out-of-tree drivers do this as well, so do
it for all three types of chips.

Tested with RTL8811CU (Tenda U9 V2.0).

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/aeeefad9-27c8-4506-a510-ef9a9a8731a4@gmail.com
---
 drivers/net/wireless/realtek/rtw88/mac.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
index 298663b03580..0c1c1ff31085 100644
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
@@ -309,6 +309,13 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
 	pwr_seq = pwr_on ? chip->pwr_on_seq : chip->pwr_off_seq;
 	ret = rtw_pwr_seq_parser(rtwdev, pwr_seq);
 
+	if (pwr_on && rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB) {
+		if (chip->id == RTW_CHIP_TYPE_8822C ||
+		    chip->id == RTW_CHIP_TYPE_8822B ||
+		    chip->id == RTW_CHIP_TYPE_8821C)
+			rtw_write8_clr(rtwdev, REG_SYS_STATUS1 + 1, BIT(0));
+	}
+
 	if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_SDIO)
 		rtw_write32(rtwdev, REG_SDIO_HIMR, imr);
 
-- 
2.43.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] wifi: rtw88: 8821cu: Fix connection failure
  2024-03-23 16:18 ` [PATCH] wifi: rtw88: 8821cu: Fix connection failure Bitterblue Smith
@ 2024-03-23 16:23   ` Greg KH
  2024-03-23 21:48     ` Bitterblue Smith
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2024-03-23 16:23 UTC (permalink / raw)
  To: Bitterblue Smith; +Cc: stable

On Sat, Mar 23, 2024 at 06:18:07PM +0200, Bitterblue Smith wrote:
> From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> 
> [ Upstream commit 605d7c0b05eecb985273b1647070497142c470d3 ]
> 
> Clear bit 8 of REG_SYS_STATUS1 after MAC power on.
> 
> Without this, some RTL8821CU and RTL8811CU cannot connect to any
> network:
> 
> Feb 19 13:33:11 ideapad2 kernel: wlp3s0f3u2: send auth to
> 	90:55:de:__:__:__ (try 1/3)
> Feb 19 13:33:13 ideapad2 kernel: wlp3s0f3u2: send auth to
> 	90:55:de:__:__:__ (try 2/3)
> Feb 19 13:33:14 ideapad2 kernel: wlp3s0f3u2: send auth to
> 	90:55:de:__:__:__ (try 3/3)
> Feb 19 13:33:15 ideapad2 kernel: wlp3s0f3u2: authentication with
> 	90:55:de:__:__:__ timed out
> 
> The RTL8822CU and RTL8822BU out-of-tree drivers do this as well, so do
> it for all three types of chips.
> 
> Tested with RTL8811CU (Tenda U9 V2.0).
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
> Signed-off-by: Kalle Valo <kvalo@kernel.org>
> Link: https://msgid.link/aeeefad9-27c8-4506-a510-ef9a9a8731a4@gmail.com
> ---
>  drivers/net/wireless/realtek/rtw88/mac.c | 7 +++++++
>  1 file changed, 7 insertions(+)

What stable kernel(s) is this to be applied to?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] wifi: rtw88: 8821cu: Fix connection failure
  2024-03-23 16:23   ` Greg KH
@ 2024-03-23 21:48     ` Bitterblue Smith
  2024-03-29  9:34       ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Bitterblue Smith @ 2024-03-23 21:48 UTC (permalink / raw)
  To: Greg KH; +Cc: stable

On 23/03/2024 18:23, Greg KH wrote:
> On Sat, Mar 23, 2024 at 06:18:07PM +0200, Bitterblue Smith wrote:
>> From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>>
>> [ Upstream commit 605d7c0b05eecb985273b1647070497142c470d3 ]
>>
>> Clear bit 8 of REG_SYS_STATUS1 after MAC power on.
>>
>> Without this, some RTL8821CU and RTL8811CU cannot connect to any
>> network:
>>
>> Feb 19 13:33:11 ideapad2 kernel: wlp3s0f3u2: send auth to
>> 	90:55:de:__:__:__ (try 1/3)
>> Feb 19 13:33:13 ideapad2 kernel: wlp3s0f3u2: send auth to
>> 	90:55:de:__:__:__ (try 2/3)
>> Feb 19 13:33:14 ideapad2 kernel: wlp3s0f3u2: send auth to
>> 	90:55:de:__:__:__ (try 3/3)
>> Feb 19 13:33:15 ideapad2 kernel: wlp3s0f3u2: authentication with
>> 	90:55:de:__:__:__ timed out
>>
>> The RTL8822CU and RTL8822BU out-of-tree drivers do this as well, so do
>> it for all three types of chips.
>>
>> Tested with RTL8811CU (Tenda U9 V2.0).
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
>> Signed-off-by: Kalle Valo <kvalo@kernel.org>
>> Link: https://msgid.link/aeeefad9-27c8-4506-a510-ef9a9a8731a4@gmail.com
>> ---
>>  drivers/net/wireless/realtek/rtw88/mac.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
> 
> What stable kernel(s) is this to be applied to?
> 
> thanks,
> 
> greg k-h

6.6, 6.7, and 6.8, please. The older ones don't have USB support
in rtw88.

Thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] wifi: rtw88: 8821cu: Fix connection failure
  2024-03-23 21:48     ` Bitterblue Smith
@ 2024-03-29  9:34       ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2024-03-29  9:34 UTC (permalink / raw)
  To: Bitterblue Smith; +Cc: stable

On Sat, Mar 23, 2024 at 11:48:07PM +0200, Bitterblue Smith wrote:
> On 23/03/2024 18:23, Greg KH wrote:
> > On Sat, Mar 23, 2024 at 06:18:07PM +0200, Bitterblue Smith wrote:
> >> From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> >>
> >> [ Upstream commit 605d7c0b05eecb985273b1647070497142c470d3 ]
> >>
> >> Clear bit 8 of REG_SYS_STATUS1 after MAC power on.
> >>
> >> Without this, some RTL8821CU and RTL8811CU cannot connect to any
> >> network:
> >>
> >> Feb 19 13:33:11 ideapad2 kernel: wlp3s0f3u2: send auth to
> >> 	90:55:de:__:__:__ (try 1/3)
> >> Feb 19 13:33:13 ideapad2 kernel: wlp3s0f3u2: send auth to
> >> 	90:55:de:__:__:__ (try 2/3)
> >> Feb 19 13:33:14 ideapad2 kernel: wlp3s0f3u2: send auth to
> >> 	90:55:de:__:__:__ (try 3/3)
> >> Feb 19 13:33:15 ideapad2 kernel: wlp3s0f3u2: authentication with
> >> 	90:55:de:__:__:__ timed out
> >>
> >> The RTL8822CU and RTL8822BU out-of-tree drivers do this as well, so do
> >> it for all three types of chips.
> >>
> >> Tested with RTL8811CU (Tenda U9 V2.0).
> >>
> >> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> >> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
> >> Signed-off-by: Kalle Valo <kvalo@kernel.org>
> >> Link: https://msgid.link/aeeefad9-27c8-4506-a510-ef9a9a8731a4@gmail.com
> >> ---
> >>  drivers/net/wireless/realtek/rtw88/mac.c | 7 +++++++
> >>  1 file changed, 7 insertions(+)
> > 
> > What stable kernel(s) is this to be applied to?
> > 
> > thanks,
> > 
> > greg k-h
> 
> 6.6, 6.7, and 6.8, please. The older ones don't have USB support
> in rtw88.

Now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-29  9:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <f12ed39d-28e8-4b8b-8d22-447bcf295afc@gmail.com>
2024-03-23 16:18 ` [PATCH] wifi: rtw88: 8821cu: Fix connection failure Bitterblue Smith
2024-03-23 16:23   ` Greg KH
2024-03-23 21:48     ` Bitterblue Smith
2024-03-29  9:34       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox