2023-06-02 01:34:54

by Utkarsh Verma

[permalink] [raw]
Subject: RTL8822BE not working after suspend

Hi everyone,

This is my first bug report on the mailing list, so please let me know
if I mess anything up.

I have an ASUS TUF FX505DT which has the RTL8822BE WiFi card. It works
fine normally without any issues. However, once I suspend my
laptop(closing the lid) for a considerable amount of time (> ~30
mins), the WiFi card doesn't work after resume and I have to reboot
every time.

This bug really undermines the portability aspect of the laptop as I
can't simply close the lid and continue my work later. The WiFi simply
dies every time I suspend, and I have to reboot.

It would be really helpful if I could get this to work in the meantime
as well with a workaround as I will be on the move soon.

Lastly, thank you for all the work put into the drivers. They work
mostly fine without any issues. This suspend issue is the only thing I
can see, and I would be glad to help to get it fixed.

My machine details:
OS: Arch Linux w/Linux 6.1.31-1-lts
Card: Realtek 8822BE WiFi
Laptop: ASUS TUF FX505DT

Please let me know if you need further information.

Regards,
Utkarsh Verma


2023-06-02 01:37:03

by Utkarsh Verma

[permalink] [raw]
Subject: Re: RTL8822BE not working after suspend

Additionally, here is the dmesg log after resuming the laptop:

Jun 02 06:25:06.698947 metia kernel: rtw_8822be 0000:04:00.0: failed
to poll offset=0x5 mask=0x2 value=0x0
Jun 02 06:25:06.699373 metia kernel: rtw_8822be 0000:04:00.0: mac
power on failed
Jun 02 06:25:06.699751 metia kernel: rtw_8822be 0000:04:00.0: failed
to power on mac
Jun 02 06:25:08.698770 metia kernel: rtw_8822be 0000:04:00.0: failed
to poll offset=0x5 mask=0x2 value=0x0
Jun 02 06:25:08.699414 metia kernel: rtw_8822be 0000:04:00.0: mac
power on failed
Jun 02 06:25:08.699800 metia kernel: rtw_8822be 0000:04:00.0: failed
to power on mac
Jun 02 06:25:20.688984 metia kernel: rtw_8822be 0000:04:00.0: failed
to poll offset=0x5 mask=0x2 value=0x0
Jun 02 06:25:20.689553 metia kernel: rtw_8822be 0000:04:00.0: mac
power on failed
Jun 02 06:25:20.689968 metia kernel: rtw_8822be 0000:04:00.0: failed
to power on mac
Jun 02 06:25:22.692089 metia kernel: rtw_8822be 0000:04:00.0: failed
to poll offset=0x5 mask=0x2 value=0x0
Jun 02 06:25:22.692584 metia kernel: rtw_8822be 0000:04:00.0: mac
power on failed
Jun 02 06:25:22.693016 metia kernel: rtw_8822be 0000:04:00.0: failed
to power on mac
Jun 02 06:25:24.958755 metia kernel: rtw_8822be 0000:04:00.0: failed
to poll offset=0x5 mask=0x2 value=0x0
Jun 02 06:25:24.959390 metia kernel: rtw_8822be 0000:04:00.0: mac
power on failed
Jun 02 06:25:24.959814 metia kernel: rtw_8822be 0000:04:00.0: failed
to power on mac

On Fri, Jun 2, 2023 at 6:59 AM Utkarsh Verma <[email protected]> wrote:
>
> Hi everyone,
>
> This is my first bug report on the mailing list, so please let me know
> if I mess anything up.
>
> I have an ASUS TUF FX505DT which has the RTL8822BE WiFi card. It works
> fine normally without any issues. However, once I suspend my
> laptop(closing the lid) for a considerable amount of time (> ~30
> mins), the WiFi card doesn't work after resume and I have to reboot
> every time.
>
> This bug really undermines the portability aspect of the laptop as I
> can't simply close the lid and continue my work later. The WiFi simply
> dies every time I suspend, and I have to reboot.
>
> It would be really helpful if I could get this to work in the meantime
> as well with a workaround as I will be on the move soon.
>
> Lastly, thank you for all the work put into the drivers. They work
> mostly fine without any issues. This suspend issue is the only thing I
> can see, and I would be glad to help to get it fixed.
>
> My machine details:
> OS: Arch Linux w/Linux 6.1.31-1-lts
> Card: Realtek 8822BE WiFi
> Laptop: ASUS TUF FX505DT
>
> Please let me know if you need further information.
>
> Regards,
> Utkarsh Verma

2023-06-02 03:53:43

by James

[permalink] [raw]
Subject: Re: RTL8822BE not working after suspend

Try a more recent kernel.


On 2023-06-01 21:33, Utkarsh Verma wrote:
> Additionally, here is the dmesg log after resuming the laptop:
>
> Jun 02 06:25:06.698947 metia kernel: rtw_8822be 0000:04:00.0: failed
> to poll offset=0x5 mask=0x2 value=0x0
> Jun 02 06:25:06.699373 metia kernel: rtw_8822be 0000:04:00.0: mac
> power on failed
> Jun 02 06:25:06.699751 metia kernel: rtw_8822be 0000:04:00.0: failed
> to power on mac
> Jun 02 06:25:08.698770 metia kernel: rtw_8822be 0000:04:00.0: failed
> to poll offset=0x5 mask=0x2 value=0x0
> Jun 02 06:25:08.699414 metia kernel: rtw_8822be 0000:04:00.0: mac
> power on failed
> Jun 02 06:25:08.699800 metia kernel: rtw_8822be 0000:04:00.0: failed
> to power on mac
> Jun 02 06:25:20.688984 metia kernel: rtw_8822be 0000:04:00.0: failed
> to poll offset=0x5 mask=0x2 value=0x0
> Jun 02 06:25:20.689553 metia kernel: rtw_8822be 0000:04:00.0: mac
> power on failed
> Jun 02 06:25:20.689968 metia kernel: rtw_8822be 0000:04:00.0: failed
> to power on mac
> Jun 02 06:25:22.692089 metia kernel: rtw_8822be 0000:04:00.0: failed
> to poll offset=0x5 mask=0x2 value=0x0
> Jun 02 06:25:22.692584 metia kernel: rtw_8822be 0000:04:00.0: mac
> power on failed
> Jun 02 06:25:22.693016 metia kernel: rtw_8822be 0000:04:00.0: failed
> to power on mac
> Jun 02 06:25:24.958755 metia kernel: rtw_8822be 0000:04:00.0: failed
> to poll offset=0x5 mask=0x2 value=0x0
> Jun 02 06:25:24.959390 metia kernel: rtw_8822be 0000:04:00.0: mac
> power on failed
> Jun 02 06:25:24.959814 metia kernel: rtw_8822be 0000:04:00.0: failed
> to power on mac
>
> On Fri, Jun 2, 2023 at 6:59 AM Utkarsh Verma <[email protected]> wrote:
>> Hi everyone,
>>
>> This is my first bug report on the mailing list, so please let me know
>> if I mess anything up.
>>
>> I have an ASUS TUF FX505DT which has the RTL8822BE WiFi card. It works
>> fine normally without any issues. However, once I suspend my
>> laptop(closing the lid) for a considerable amount of time (> ~30
>> mins), the WiFi card doesn't work after resume and I have to reboot
>> every time.
>>
>> This bug really undermines the portability aspect of the laptop as I
>> can't simply close the lid and continue my work later. The WiFi simply
>> dies every time I suspend, and I have to reboot.
>>
>> It would be really helpful if I could get this to work in the meantime
>> as well with a workaround as I will be on the move soon.
>>
>> Lastly, thank you for all the work put into the drivers. They work
>> mostly fine without any issues. This suspend issue is the only thing I
>> can see, and I would be glad to help to get it fixed.
>>
>> My machine details:
>> OS: Arch Linux w/Linux 6.1.31-1-lts
>> Card: Realtek 8822BE WiFi
>> Laptop: ASUS TUF FX505DT
>>
>> Please let me know if you need further information.
>>
>> Regards,
>> Utkarsh Verma


2023-06-02 04:28:17

by Utkarsh Verma

[permalink] [raw]
Subject: Re: RTL8822BE not working after suspend

I had been using Linux v6.3.5 for a while and switched to v6.1.31-lts
only yesterday, hoping it might work. The same issue happens on newer
kernels like Linux v6.3.5 as well.

On Fri, Jun 2, 2023 at 9:20 AM James <[email protected]> wrote:
>
> Try a more recent kernel.
>
>
> On 2023-06-01 21:33, Utkarsh Verma wrote:
> > Additionally, here is the dmesg log after resuming the laptop:
> >
> > Jun 02 06:25:06.698947 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to poll offset=0x5 mask=0x2 value=0x0
> > Jun 02 06:25:06.699373 metia kernel: rtw_8822be 0000:04:00.0: mac
> > power on failed
> > Jun 02 06:25:06.699751 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to power on mac
> > Jun 02 06:25:08.698770 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to poll offset=0x5 mask=0x2 value=0x0
> > Jun 02 06:25:08.699414 metia kernel: rtw_8822be 0000:04:00.0: mac
> > power on failed
> > Jun 02 06:25:08.699800 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to power on mac
> > Jun 02 06:25:20.688984 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to poll offset=0x5 mask=0x2 value=0x0
> > Jun 02 06:25:20.689553 metia kernel: rtw_8822be 0000:04:00.0: mac
> > power on failed
> > Jun 02 06:25:20.689968 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to power on mac
> > Jun 02 06:25:22.692089 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to poll offset=0x5 mask=0x2 value=0x0
> > Jun 02 06:25:22.692584 metia kernel: rtw_8822be 0000:04:00.0: mac
> > power on failed
> > Jun 02 06:25:22.693016 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to power on mac
> > Jun 02 06:25:24.958755 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to poll offset=0x5 mask=0x2 value=0x0
> > Jun 02 06:25:24.959390 metia kernel: rtw_8822be 0000:04:00.0: mac
> > power on failed
> > Jun 02 06:25:24.959814 metia kernel: rtw_8822be 0000:04:00.0: failed
> > to power on mac
> >
> > On Fri, Jun 2, 2023 at 6:59 AM Utkarsh Verma <[email protected]> wrote:
> >> Hi everyone,
> >>
> >> This is my first bug report on the mailing list, so please let me know
> >> if I mess anything up.
> >>
> >> I have an ASUS TUF FX505DT which has the RTL8822BE WiFi card. It works
> >> fine normally without any issues. However, once I suspend my
> >> laptop(closing the lid) for a considerable amount of time (> ~30
> >> mins), the WiFi card doesn't work after resume and I have to reboot
> >> every time.
> >>
> >> This bug really undermines the portability aspect of the laptop as I
> >> can't simply close the lid and continue my work later. The WiFi simply
> >> dies every time I suspend, and I have to reboot.
> >>
> >> It would be really helpful if I could get this to work in the meantime
> >> as well with a workaround as I will be on the move soon.
> >>
> >> Lastly, thank you for all the work put into the drivers. They work
> >> mostly fine without any issues. This suspend issue is the only thing I
> >> can see, and I would be glad to help to get it fixed.
> >>
> >> My machine details:
> >> OS: Arch Linux w/Linux 6.1.31-1-lts
> >> Card: Realtek 8822BE WiFi
> >> Laptop: ASUS TUF FX505DT
> >>
> >> Please let me know if you need further information.
> >>
> >> Regards,
> >> Utkarsh Verma
>

2023-06-02 14:04:11

by James

[permalink] [raw]
Subject: Re: RTL8822BE not working after suspend

https://bugzilla.kernel.org/show_bug.cgi?id=216386

You could try https://github.com/lwfinger/rtw88

Jun. 2, 2023 00:19:28 Utkarsh Verma <[email protected]>:

> I had been using Linux v6.3.5 for a while and switched to v6.1.31-lts
> only yesterday, hoping it might work. The same issue happens on newer
> kernels like Linux v6.3.5 as well.
>
> On Fri, Jun 2, 2023 at 9:20 AM James <[email protected]> wrote:
>>
>> Try a more recent kernel.
>>
>>
>> On 2023-06-01 21:33, Utkarsh Verma wrote:
>>> Additionally, here is the dmesg log after resuming the laptop:
>>>
>>> Jun 02 06:25:06.698947 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to poll offset=0x5 mask=0x2 value=0x0
>>> Jun 02 06:25:06.699373 metia kernel: rtw_8822be 0000:04:00.0: mac
>>> power on failed
>>> Jun 02 06:25:06.699751 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to power on mac
>>> Jun 02 06:25:08.698770 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to poll offset=0x5 mask=0x2 value=0x0
>>> Jun 02 06:25:08.699414 metia kernel: rtw_8822be 0000:04:00.0: mac
>>> power on failed
>>> Jun 02 06:25:08.699800 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to power on mac
>>> Jun 02 06:25:20.688984 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to poll offset=0x5 mask=0x2 value=0x0
>>> Jun 02 06:25:20.689553 metia kernel: rtw_8822be 0000:04:00.0: mac
>>> power on failed
>>> Jun 02 06:25:20.689968 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to power on mac
>>> Jun 02 06:25:22.692089 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to poll offset=0x5 mask=0x2 value=0x0
>>> Jun 02 06:25:22.692584 metia kernel: rtw_8822be 0000:04:00.0: mac
>>> power on failed
>>> Jun 02 06:25:22.693016 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to power on mac
>>> Jun 02 06:25:24.958755 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to poll offset=0x5 mask=0x2 value=0x0
>>> Jun 02 06:25:24.959390 metia kernel: rtw_8822be 0000:04:00.0: mac
>>> power on failed
>>> Jun 02 06:25:24.959814 metia kernel: rtw_8822be 0000:04:00.0: failed
>>> to power on mac
>>>
>>> On Fri, Jun 2, 2023 at 6:59 AM Utkarsh Verma <[email protected]> wrote:
>>>> Hi everyone,
>>>>
>>>> This is my first bug report on the mailing list, so please let me know
>>>> if I mess anything up.
>>>>
>>>> I have an ASUS TUF FX505DT which has the RTL8822BE WiFi card. It works
>>>> fine normally without any issues. However, once I suspend my
>>>> laptop(closing the lid) for a considerable amount of time (> ~30
>>>> mins), the WiFi card doesn't work after resume and I have to reboot
>>>> every time.
>>>>
>>>> This bug really undermines the portability aspect of the laptop as I
>>>> can't simply close the lid and continue my work later. The WiFi simply
>>>> dies every time I suspend, and I have to reboot.
>>>>
>>>> It would be really helpful if I could get this to work in the meantime
>>>> as well with a workaround as I will be on the move soon.
>>>>
>>>> Lastly, thank you for all the work put into the drivers. They work
>>>> mostly fine without any issues. This suspend issue is the only thing I
>>>> can see, and I would be glad to help to get it fixed.
>>>>
>>>> My machine details:
>>>> OS: Arch Linux w/Linux 6.1.31-1-lts
>>>> Card: Realtek 8822BE WiFi
>>>> Laptop: ASUS TUF FX505DT
>>>>
>>>> Please let me know if you need further information.
>>>>
>>>> Regards,
>>>> Utkarsh Verma
>>

2023-06-02 17:09:20

by Larry Finger

[permalink] [raw]
Subject: Re: RTL8822BE not working after suspend

On 6/2/23 08:59, James wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=216386
>
> You could try https://github.com/lwfinger/rtw88
>
> Jun. 2, 2023 00:19:28 Utkarsh Verma <[email protected]>:
>
>> I had been using Linux v6.3.5 for a while and switched to v6.1.31-lts
>> only yesterday, hoping it might work. The same issue happens on newer
>> kernels like Linux v6.3.5 as well.

Utkarsh,

Although James top posting made it difficult to send this properly, he is
correct to suggest using the rtw88 repo at GitHub.com. It contains code that
will not be in released kernels until v6.5.

Most systems handle suspend or hibernation correctly, there are some that do
not. To my knowledge, all of these have been recent HP or Lenovo laptops where
the BIOS does not handle D3HOT to D0 transitions.

If using rtw88 does not help your system, your best resolution is to install a
script in /usr/lib/systemd/system-sleep/ that will unload the driver before
sleep/hibernation, and restore it on resume. Repo rtw88 has scripts for all of
the PCI drivers, and README.md tells you what to do.

Larry



2023-06-07 01:07:22

by Utkarsh Verma

[permalink] [raw]
Subject: Re: RTL8822BE not working after suspend

Hi Larry,

Thanks for the clarification. I tried the rtw88 drivers as you
mentioned, and the card works for me after suspend finally. Although,
I did need to use the suspend scripts provided.

I have a small request from my side as a user. Please mention on the
GitHub repo that these drivers are not in the kernel yet and will be
merged around Linux 6.5. This is because I stumbled upon this repo a
couple of times before as well, but I did not trust it enough and even
thought that they might be older than the kernel's drivers.

Additionally, is there any way we can have this working without the
systems module loading/unloading shenanigans? I would love to see this
work by default, as it does on Windows. I can help you with the driver
testing if you wish.

The bug which happens after suspend is, as you mentioned, the card
fails to change the power state from D3cold to D0.

Thanks a lot.
Regards,
Utkarsh

On Fri, Jun 2, 2023 at 10:34 PM Larry Finger <[email protected]> wrote:
>
> On 6/2/23 08:59, James wrote:
> > https://bugzilla.kernel.org/show_bug.cgi?id=216386
> >
> > You could try https://github.com/lwfinger/rtw88
> >
> > Jun. 2, 2023 00:19:28 Utkarsh Verma <[email protected]>:
> >
> >> I had been using Linux v6.3.5 for a while and switched to v6.1.31-lts
> >> only yesterday, hoping it might work. The same issue happens on newer
> >> kernels like Linux v6.3.5 as well.
>
> Utkarsh,
>
> Although James top posting made it difficult to send this properly, he is
> correct to suggest using the rtw88 repo at GitHub.com. It contains code that
> will not be in released kernels until v6.5.
>
> Most systems handle suspend or hibernation correctly, there are some that do
> not. To my knowledge, all of these have been recent HP or Lenovo laptops where
> the BIOS does not handle D3HOT to D0 transitions.
>
> If using rtw88 does not help your system, your best resolution is to install a
> script in /usr/lib/systemd/system-sleep/ that will unload the driver before
> sleep/hibernation, and restore it on resume. Repo rtw88 has scripts for all of
> the PCI drivers, and README.md tells you what to do.
>
> Larry
>
>

2023-06-07 16:10:27

by Larry Finger

[permalink] [raw]
Subject: Re: RTL8822BE not working after suspend

On 6/6/23 20:04, Utkarsh Verma wrote:
> I have a small request from my side as a user. Please mention on the
> GitHub repo that these drivers are not in the kernel yet and will be
> merged around Linux 6.5. This is because I stumbled upon this repo a
> couple of times before as well, but I did not trust it enough and even
> thought that they might be older than the kernel's drivers.
>
> Additionally, is there any way we can have this working without the
> systems module loading/unloading shenanigans? I would love to see this
> work by default, as it does on Windows. I can help you with the driver
> testing if you wish.

I could make it more clear in the README.md that the rtw88 repo has code that
will be in a future kernel, but that information is available in the git logs. I
cannot help your trust issues!

The problems with your BIOS that require unloading and reloading the driver when
suspending or hibernating are found only in some HP or Lenovo laptops. It is
beyond my capability to fix the actual bug, thus we give you a workaround. What
does the Windows driver actually do to overcome this problem? As none of us have
seen that code, we have no idea!!

What harm is there in running the unload/restore script? On my laptop, it is
totally transparent except for a few extra lines in the log.

Larry


2023-06-20 02:25:51

by Utkarsh Verma

[permalink] [raw]
Subject: Re: RTL8822BE not working after suspend

Hi,

I just wanted to that after a couple of weeks of testing, I still
couldn't get reliable behaviour. I installed the new Realtek drivers
with the systems loading/unloading script. Sometimes my WiFi works
after resume, sometimes it doesn't. I tried finding patterns, but
couldn't. Please let me know how we can investigate this.

Regards,
Utkarsh


On Wed, Jun 7, 2023 at 9:25 PM Larry Finger <[email protected]> wrote:
>
> On 6/6/23 20:04, Utkarsh Verma wrote:
> > I have a small request from my side as a user. Please mention on the
> > GitHub repo that these drivers are not in the kernel yet and will be
> > merged around Linux 6.5. This is because I stumbled upon this repo a
> > couple of times before as well, but I did not trust it enough and even
> > thought that they might be older than the kernel's drivers.
> >
> > Additionally, is there any way we can have this working without the
> > systems module loading/unloading shenanigans? I would love to see this
> > work by default, as it does on Windows. I can help you with the driver
> > testing if you wish.
>
> I could make it more clear in the README.md that the rtw88 repo has code that
> will be in a future kernel, but that information is available in the git logs. I
> cannot help your trust issues!
>
> The problems with your BIOS that require unloading and reloading the driver when
> suspending or hibernating are found only in some HP or Lenovo laptops. It is
> beyond my capability to fix the actual bug, thus we give you a workaround. What
> does the Windows driver actually do to overcome this problem? As none of us have
> seen that code, we have no idea!!
>
> What harm is there in running the unload/restore script? On my laptop, it is
> totally transparent except for a few extra lines in the log.
>
> Larry
>

2023-06-20 02:46:18

by Larry Finger

[permalink] [raw]
Subject: Re: RTL8822BE not working after suspend

On 6/19/23 21:03, Utkarsh Verma wrote:
> Hi,
>
> I just wanted to that after a couple of weeks of testing, I still
> couldn't get reliable behaviour. I installed the new Realtek drivers
> with the systems loading/unloading script. Sometimes my WiFi works
> after resume, sometimes it doesn't. I tried finding patterns, but
> couldn't. Please let me know how we can investigate this.

Perhaps your power system is taking longer to stabilize.

You might try modifying the unloading/loading script to have something line

#!/bin/sh
if [ "${1}" == "pre" ]; then
modprobe -rv rtw_8822be
elif [ "${1}" == "post" ]; then
sleep 20
modprobe -v rtw_8822be
fi

If that still does not work, I have no idea what might be causing the problem.
If it does work, try halving the sleep interval from 20 sec to 10, etc until it
breaks again.

Larry