Bug 216386 - rtw_8822be: Wifi stops working after resume
Summary: rtw_8822be: Wifi stops working after resume
Status: NEEDINFO
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 high
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-20 09:16 UTC by Utkarsh Verma
Modified: 2022-09-12 07:36 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.19.2
Tree: Mainline
Regression: Yes


Attachments

Description Utkarsh Verma 2022-08-20 09:16:41 UTC
I have an ASUS TUF FX505DT which has the RTL8822BE wifi card. I recently upgraded to kernel 5.19 and this issue started popping up.

When I close my laptop lid and let it sleep for a considerable amount of time, the wifi stops working the next time I open it, and I have to reboot my PC to get internet. This is annoying because I suspended my PC to continue with my work after some time quickly, and having to reboot defeats the purpose.

I tried removing and reloading the kernel module for this device as well, and it fails with the following dmesg log.

```
[ 4914.877037] rtw_8822be 0000:04:00.0: Unable to change power state from D3cold to D0, device inaccessible
[ 4914.886333] rtw_8822be 0000:04:00.0: mac power on failed
[ 4914.886342] rtw_8822be 0000:04:00.0: failed to power on mac
[ 4914.886344] rtw_8822be 0000:04:00.0: failed to setup chip efuse info
[ 4914.886348] rtw_8822be 0000:04:00.0: failed to setup chip information
[ 4914.892027] rtw_8822be 0000:04:00.0: Firmware version 27.2.0, H2C version 13
[ 4914.922150] rtw_8822be: probe of 0000:04:00.0 failed with error -114
```
Comment 1 Artem S. Tashkinov 2022-08-26 06:52:24 UTC
CC'ing Ping-Ke Shih - please check.

OP, would be great if you performed git bisect:

https://docs.kernel.org/admin-guide/bug-bisect.html
https://ldpreload.com/blog/git-bisect-run
https://wiki.gentoo.org/wiki/Kernel_git-bisect
Comment 2 Ping-Ke Shih 2022-08-29 02:08:27 UTC
>  rtw_8822be 0000:04:00.0: Unable to change power state from D3cold to D0,
>  device inaccessible


That means card loss, so I suggest to turn off ASPM via module parameter
disable_aspm=y


I'm trying to reproduce this issue in my side, but I can't.
Could you also share the old kernel version you used? 
Then, I can dig deeper to see which patch can cause this issue.
Comment 3 Utkarsh Verma 2022-08-31 15:54:25 UTC
Wouldn't turning off aspm lead to battery drain during suspend?

Also, the kernel on which I faced this issue was 5.19.2 as far as I can remember.
Comment 4 Ping-Ke Shih 2022-09-01 00:24:41 UTC
> Wouldn't turning off aspm lead to battery drain during suspend?

During suspend, wifi card turns off power entirely, no matter with/without aspm.

This is an experiment to bisect which causes this symptom.
Please set disable_aspm=y and cold reboot before suspend.

> the kernel on which I faced this issue was 5.19.2 as far as I can remember.

Do you remember the kernel version that works before you upgrade to 5.19.2?
Can 5.18 work well?
Comment 5 Utkarsh Verma 2022-09-03 06:41:29 UTC
Yes, it used to work on kernel 5.18 versions. I used disable_aspm=y on kernel 5.19.6 and WiFi worked fine after 8 hours of suspension. Still not sure if this was fixed in kernel 5.19.6, therefore, I'll re-enable aspm and update here in a couple of days of usage.
Comment 6 Utkarsh Verma 2022-09-11 16:38:51 UTC
Okay, so after some prolonged usage, I noticed that `disable_aspm=y` in the kernel cmdline didn't affect anything. I got the same issue with and without it on kernel 5.19.7.

```
$ uname -a
Linux metia 5.19.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 05 Sep 2022 18:09:09 +0000 x86_64 GNU/Linux
```

Here are the details:
**Without `disable_aspm=y`**
root=/dev/nvme0n1p4 resume=/dev/nvme0n1p6 rw quiet bgrt_disable i8042.noaux i8042.nomux iommu.passthrough=1

dmesg log: https://pastebin.com/7b8vd9Jh

**With `disable_aspm=y`**
root=/dev/nvme0n1p4 resume=/dev/nvme0n1p6 rw quiet bgrt_disable i8042.noaux i8042.nomux iommu.passthrough=1 disable_aspm=y 

dmesg log: https://pastebin.com/sCakbm98
Comment 7 Ping-Ke Shih 2022-09-12 07:36:55 UTC
I checked patches from 5.18 to 5.19.6. It seems no significant patch could cause this issue. Could you help to check if 5.18 really work well for you?


Another try is to set module parameter: disable_lps_deep=y
or, use 'iw wlan0 set power_save off' to turn off power saving.
Please try if this can help you.

Note You need to log in before you can comment on or make changes to this bug.