RTL8822BE [10ec:b822] network driver rtl_wifi crashes on boot in Focal Fossa 20.04 - 5.4.0-21-generic and mainline 5.7.0-050700rc1-generic

Bug #1872984 reported by Matthew M on 2020-04-15
124
This bug affects 25 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
Unassigned

Bug Description

RTL8822BE crashes after rtw_pci starts on boot after kernel update to 5.4.0-21 (fails to read DBI register -- see attached dmesg). Issue is still present on latest mainline kernel version 5.7.0-050700rc1-generic .

[ 10.627501] rtw_pci 0000:3a:00.0: start vif 5c:ea:1d:b6:17:11 on port 0
[ 10.714544] ------------[ cut here ]------------
[ 10.714545] failed to read DBI register, addr=0x0719
[ 10.714577] WARNING: CPU: 0 PID: 939 at drivers/net/wireless/realtek/rtw88/pci.c:1156 rtw_dbi_read8.constprop.0+0xaa/0xc0 [rtwpci]
[ 10.714577] Modules linked in: (see attached dmesg)
[ 10.714614] CPU: 0 PID: 939 Comm: wpa_supplicant Not tainted 5.7.0-050700rc1-generic #202004122032
[ 10.714614] Hardware name: LENOVO 81CU/LNVNB161216, BIOS 7KCN22WW(V1.03) 01/23/2018
[ 10.714616] RIP: 0010:rtw_dbi_read8.constprop.0+0xaa/0xc0 [rtwpci]
[ 10.714617] Code: 03 00 00 48 8b 40 50 e8 24 c3 4b e0 5b 41 5c 41 88 45 00 31 c0 41 5d 5d c3 be 19 07 00 00 48 c7 c7 70 73 94 c0 e8 bb de 75 df <0f> 0b b8 fb ff ff ff 5b 41 5c 41 5d 5d c3 0f 1f 84 00 00 00 00 00
[ 10.714618] RSP: 0018:ffffb466007e7880 EFLAGS: 00010282
[ 10.714618] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000007
[ 10.714619] RDX: 0000000000000007 RSI: 0000000000000092 RDI: ffff933cc9e19c80
[ 10.714619] RBP: ffffb466007e7898 R08: 00000000000003d2 R09: 0000000000000004
[ 10.714620] R10: 0000000000000000 R11: 0000000000000001 R12: ffff933cbdf31ea0
[ 10.714620] R13: ffffb466007e78af R14: ffff933cbdf35bc8 R15: 0000000000000000
[ 10.714622] FS: 00007fbcedc6efc0(0000) GS:ffff933cc9e00000(0000) knlGS:0000000000000000
[ 10.714622] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 10.714623] CR2: 0000563278766000 CR3: 00000002be7a4002 CR4: 00000000003606f0
[ 10.714623] Call Trace:
[ 10.714627] rtw_pci_link_ps+0x4e/0x90 [rtwpci]
[ 10.714630] ? _raw_spin_unlock_bh+0x1e/0x20
[ 10.714637] rtw_leave_ips+0x1f/0x80 [rtw88]
[ 10.714640] rtw_ops_config+0xa3/0xe0 [rtw88]
[ 10.714658] ieee80211_hw_config+0x95/0x390 [mac80211]
[ 10.714669] ieee80211_recalc_idle+0x27/0x30 [mac80211]
[ 10.714679] __ieee80211_start_scan+0x334/0x750 [mac80211]
[ 10.714688] ieee80211_request_scan+0x30/0x50 [mac80211]
[ 10.714699] ieee80211_scan+0x5c/0xa0 [mac80211]
[ 10.714719] nl80211_trigger_scan+0x59a/0x6c0 [cfg80211]
[ 10.714722] genl_rcv_msg+0x1a8/0x470
[ 10.714724] ? ep_poll_callback+0x2a0/0x2c0
[ 10.714725] ? genl_family_rcv_msg_attrs_parse+0x100/0x100
[ 10.714726] netlink_rcv_skb+0x50/0x120
[ 10.714728] genl_rcv+0x29/0x40
[ 10.714729] netlink_unicast+0x1a8/0x250
[ 10.714730] netlink_sendmsg+0x233/0x460
[ 10.714739] ? _copy_from_user+0x31/0x60
[ 10.714750] sock_sendmsg+0x65/0x70
[ 10.714751] ____sys_sendmsg+0x212/0x280
[ 10.714752] ? copy_msghdr_from_user+0x5c/0x90
[ 10.714755] ? __check_object_size+0x4d/0x150
[ 10.714756] ___sys_sendmsg+0x81/0xc0
[ 10.714757] ? __check_object_size+0x4d/0x150
[ 10.714759] ? unix_ioctl+0x99/0x180
[ 10.714760] ? sock_getsockopt+0x198/0xc04
[ 10.714761] ? sock_do_ioctl+0x47/0x140
[ 10.714763] ? __cgroup_bpf_run_filter_setsockopt+0xae/0x2c0
[ 10.714765] ? _cond_resched+0x19/0x30
[ 10.714767] ? aa_sk_perm+0x43/0x1b0
[ 10.714768] __sys_sendmsg+0x5c/0xa0
[ 10.714770] __x64_sys_sendmsg+0x1f/0x30
[ 10.714772] do_syscall_64+0x57/0x1b0
[ 10.714773] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 10.714774] RIP: 0033:0x7fbcedffb5b7
[ 10.714775] Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10
[ 10.714776] RSP: 002b:00007fff88e22288 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
[ 10.714777] RAX: ffffffffffffffda RBX: 00005632787355d0 RCX: 00007fbcedffb5b7
[ 10.714777] RDX: 0000000000000000 RSI: 00007fff88e222c0 RDI: 0000000000000006
[ 10.714778] RBP: 0000563278761380 R08: 0000000000000004 R09: 0000563278761380
[ 10.714778] R10: 00007fff88e22394 R11: 0000000000000246 R12: 00005632787354e0
[ 10.714779] R13: 00007fff88e222c0 R14: 00007fff88e22394 R15: 0000563278766710
[ 10.714780] ---[ end trace f00c16109236af6f ]---
[ 10.714782] rtw_pci 0000:3a:00.0: failed to read ASPM, ret=-5

Device is unable to scan for networks and error occurs when attempting to turn on/off wifi in settings:

[ 302.451636] rtw_pci 0000:3a:00.0: stop vif 5c:ea:1d:b6:17:11 on port 0
[ 308.820551] rtw_pci 0000:3a:00.0: mac power on failed
[ 308.820554] rtw_pci 0000:3a:00.0: failed to power on mac

However, issue is NOT present for me on kernel version 5.4.0-18-generic (but is present on 5.4.0-21-generic and 5.7.0- as mentioned above). Changing kernel versions with grub has been a temporary solution.

Relevant log files are attached from tests in both kernel versions mentioned above (5.4.0-21 and 5.7.0-). Additional log files can be added upon request, as I am able to repeat this simply by changing kernel versions in grub.

Matthew M (matthewl) wrote :
Matthew M (matthewl) wrote :

I am unsure how to attach multiple log files so here are the contents of the short logs. Attached is the output of "lspci -vvnn" in 5.7.0-rc1

Output of "uname -a" on 5.7.0:

Linux laptop 5.7.0-050700rc1-generic #202004122032 SMP Sun Apr 12 20:36:25 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

---
"cat /proc/version" on 5.7.0 yields:

Linux version 5.7.0-050700rc1-generic (kernel@sita) (gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu1), GNU ld (GNU Binutils for Ubuntu) 2.34) #202004122032 SMP Sun Apr 12 20:36:25 UTC 2020

---
"cat /proc/version" on 5.4.0-21 yields:

Ubuntu 5.4.0-21.25-generic 5.4.27

---
"uname -a" on 5.4.0 yields:

Linux laptop 5.4.0-21-generic #25-Ubuntu SMP Sat Mar 28 13:10:28 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Matthew M (matthewl) wrote :
Matthew M (matthewl) wrote :
Matthew M (matthewl) on 2020-04-15
tags: added: amd64 focal kernel-bug kernel-bug-exists-upstream

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Matthew M (matthewl) on 2020-04-15
summary: - RTL8822BE network driver now crashes on boot in Focal Fossa 20.04 -
+ RTL8822BE network driver rtl_wifi crashes on boot in Focal Fossa 20.04 -
5.4.0-21-generic and mainline 5.7.0-050700rc1-generic

The crash also occurs in the kernel version 5.6.0-8-generic #8~lp1872984 linked above; however, two distinct behaviors are present depending on whether or not wifi was ON/OFF in NetworkManager. If it was enabled previously, and then the machine is powered off and back on, the driver appears to send an auth to the default network before crashing (explained below, c.f. attached dmesg logs). Regardless, it will crash and fail to power on if it is turned off and back on in NetworkManager.Case 1 (on):   Boot 1: (Was connected to network on kernel 5.4.0-18, powered off device, then powered on and changed kernel to 5.6.0lp in grub) - The network driver successfully authed with the default network and I was even able to ping google.com. After turning wifi off and then back on again, the network driver is unable to scan for networks and shows a crash in dmesg (dmesg-auth1.log)   Boot 2: (Powered off and restarted after previous attempt, no settings changed) The network driver appeared to auth in dmesg with the specified network then immediately crash. Attempts to turn OFF/ON again in networkmanager result in "fail to power on mac" error in dmesg (dmesg-auth2.log)Case 2 (off):   Boot 3: (Turned off wifi in NetworkManager after boot 2, then powered off and restarted machine) Network driver crashes after enabled on boot and fails to power on when turning off/on in networkmanager (c.f. [5.611939] rtw_pci 0000:3a:00.0: start vif 5c:ea:1d:b6:17:11 on port 0) (dmesg-lp-crash.log)

After adding rtw_pci to /etc/modprobe.d/blacklist.conf , running "sudo depmod -a" and "sudo update-initramfs -u -k '5.6.0-8-generic'" and rebooting, rtw_pci was loaded by the other driver "rtwpci". Adding "rtwpci" to the blacklist and rebooting, "lspci -vvnn" gives a proper output for the network device. However, with disabling these two drivers there is zero internet functionality since the device does not have a driver associated with it and the kernel does not have one available to load, of course.  Attached is both the dmesg and lspci outputs from when both of these modules were blacklisted. I was expecting the kernel to load the old realtek network driver 'rtlwifi' instead, but I guess it is no longer installed.

Ayush Shanker (ayush4) wrote :

Still getting the same errors (with no blacklists in /etc/modprobe.d)

lspci output: https://gist.github.com/ayush--s/46489a2c8ae2a42e58219c4b22fef6ef

# uname -a
Linux box 5.6.0-8-generic #8~lp1872984+2 SMP Fri Apr 17 11:35:19 CST 2020 x86_64 x86_64 x86_64 GNU/Linux

Kai-Heng Feng (kaihengfeng) wrote :

Is the system Lenovo Yoga? Can you please update BIOS and see if the issue goes away?

You-Sheng Yang (vicamo) on 2020-04-23
tags: added: hwe-networking-wifi
Ayush Shanker (ayush4) wrote :

The system is Asus Vivobook 14. See https://gist.github.com/ayush--s/46489a2c8ae2a42e58219c4b22fef6ef#file-dmesg-log-L781 for full hardware details captured in dmesg.

Ste Venso (stevenso) wrote :

Hi,

I have same issue here with same Asus laptop.
`kernel: DMI: ASUSTeK COMPUTER INC. VivoBook_ASUSLaptop X430FN_S430FN/X430FN, BIOS X430FN.308 05/28/2019`

It seems I have to step back to 19.10.
:-(

by. sTv

Juan Lopes (juanplopes) wrote :

I had the same problem with Lenovo Flex 6 14IKB on Focal Fossa (5.4.0-28). I followed Kai-Heng Feng's sugggestion and updated the BIOS. Luckily I had a dual-boot Windows on that machine and was able to do so easily. Now it's working flawlessly.

Luke Peters (lukepeters) wrote :

After a firmware update, I also can confirm that the issue was resolved on a Lenovo Yoga 730.

Changed in linux (Ubuntu):
status: Incomplete → Invalid
George Mihai Lazu (glazu) wrote :

I am experiencing the same issue on a Lenovo Y530-15ICH. After BIOS update, the issue seemed to no longer occur, however, it has now reappeared.
I am currently running BIOS version 8JCN53WW (Dec 2019), the latest.

Josh Bauer (augray) wrote :

I can also vouch that I run into this issue on a Lenovo Y530-15ICH after upgrading to Focal Fossa. I haven't upgraded my BIOS (I'm afraid to until I'm certain I'm doing it correctly).

Kai-Heng Feng (kaihengfeng) wrote :

Does cold boot help?

hoku (pe83) on 2020-07-06
description: updated
hoku (pe83) wrote :

I'm on Lenovo Legion Y530-15ICH and I have the same issue.
It's been too long without this fixed.

I am currently running BIOS version 8JCN50WW and I suspect that upgrading the BIOS is not going to be the solution.

Does anyone know what this message mean??

07:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822BE 802.11a/b/g/n/ac WiFi adapter (rev ff) (prog-if ff)
        !!! Unknown header type 7f <------------------------------ ???
        Kernel driver in use: rtw_pci
        Kernel modules: rtwpci

Kai-Heng Feng (kaihengfeng) wrote :

hoku,

Does a cold boot resolve the issue?

campus (nelucampean) wrote :

Cold boot does not help.
WiFi has a very strange behavior:
If I cold boot the WiFi crashes after a random period of time.
Also, I've noticed that using torrent clients or accessing speed-test pages like fast.com tend to trigger the error (might be high WiFi load ???? )
If I reboot after a crash the WiFi will crash again.
If I reboot into windows after a crash and then reboot into Linux the WiFi works fine.
And then, I discovered that if i cold boot into windows and then reboot to Linux the WiFi also works fine. (last time I used it for three hours without any crash)

I've installed focal now on the laptop and I use it as a primary OS. The only catch is that I have to boot cycle through windows in order to have a functional WiFi.

I cannot thing of a reasonable explanation for this bug!!!!

Kai-Heng Feng (kaihengfeng) wrote :

campus, can you please attach full dmesg?

hoku (pe83) wrote :

I have posted all the information in here
https://answers.launchpad.net/ubuntu/+question/691415

If you need anything else please let me know.

I can't believe that this issue is still going on..

Changed in linux (Ubuntu):
status: Invalid → Confirmed
George Mihai Lazu (glazu) wrote :

@pe83 As of today, I am still experiencing these issues with a fresh install of Ubuntu 20 on a Lenovo Legion Y530-15ICH.
The only solution I see fit at this time is a downgrade to 19.

You-Sheng Yang (vicamo) on 2020-08-21
summary: - RTL8822BE network driver rtl_wifi crashes on boot in Focal Fossa 20.04 -
- 5.4.0-21-generic and mainline 5.7.0-050700rc1-generic
+ RTL8822BE [10ec:b822] network driver rtl_wifi crashes on boot in Focal
+ Fossa 20.04 - 5.4.0-21-generic and mainline 5.7.0-050700rc1-generic
You-Sheng Yang (vicamo) wrote :

https://bugzilla.kernel.org/show_bug.cgi?id=206411#c9 stated it may relate to the power sequence of a specific platform. I have also RTL8822BE installed, but it works on every Focal/Groovy + 5.4.0-42/5.7-rc1/5.8.0-16/5.9-rc1 combination.

Kai-Heng Feng (kaihengfeng) wrote :

Can you guys please test this kernel:
https://people.canonical.com/~khfeng/lp1872984-d3/

You-Sheng Yang (vicamo) wrote :

Set to INCOMPLETE for comment #28. Please reset it back to CONFIRMED or other appropriate state with comments for the result of the test kernel in comment #28.

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
campus (nelucampean) wrote :

The problem persists in the tested 5.9 kernel (tried with cold boot and reboot).
Also, if I boot cycle through windows the wifi works.
I attached the dmesg.

Kai-Heng Feng (kaihengfeng) wrote :

Hi, please test the kernel via several reboots.

Kai-Heng Feng (kaihengfeng) wrote :

i.e. something like Windows -> Linux -> Linux -> Linux

George Mihai Lazu (glazu) wrote :

Without testing the new kernel (I have 5.4.0-42-generic), I have tried https://bugzilla.kernel.org/show_bug.cgi?id=206411#c11, and then booted to Windows, connected to a network, and powered off windows with the "Fast Boot" option disabled in Power Options.

So far, with several reboots, the wifi works correctly. I will be updating you if the issue reappears, but so far this seems to be a good fix for me.

George Mihai Lazu (glazu) wrote :

Hello Kai.
After several reboots this morning I was convinced the issue would no longer reproduce. A couple minutes ago I have rebooted the system and the issue reproduced, and I was unable to get the wifi card working even though I have rebooted into Windows and back into Linux several times.

I have installed 5.9.0-rc1+ and tried rebooting again into Windows and then Linux, this time successfully connecting to Wifi.

I will be updating you if the issue reproduces. Let me know if you need any kind of logs that could help debug this issue.

I was on kernel version 5.4.0.47-generic and was using the rtl8822be repo of mid-kid on github. I didn't even need to boot on windoes first to get wifi working, it was all fine, however when I updated to 5.4.0.48-generic that one stopped working, therefore I tried installing the kernel above (5.9.0-rc1+) and I couldn't even boot to ubuntu. Now I've returned to my working 5.4.0.47-generic and I'll stay so, here is the reason why I couldn't boot into ubuntu

Airidas Sarkunas (lunion) wrote :

Lenovo Y530-15ICH, dual boot Windows 10 and fresh Ubuntu 20.04 install, seperate drives,UEFI. Kernel version 5.4.0-52-generic. Wifi card: RTL8822BE. Worked on the first day, stopped on the second one. Mostly shows "no networks" although sometimes when I reboot I get "Wifi adapter not found". Tried rtw88 drivers, as well as r8822be. Secure boot off, bios Version: 8JCN52WW (06/14/2019).

Pablo (itu-pablo) wrote :

I can confirm this problem exists on Lenovo Flex 6 14IKB, on both Ubuntu 20.04 (using 5.4.0-26-generic and above) and on 20.10 (using 5.8.0-25-generic).

Upgrading BIOS to latest did NOT solve this issue for me.

As others have reported, wifi appears to work normally for a while, but in my case it stops working after I ask NetworkManager to connect to a network.

Pablo (itu-pablo) on 2020-10-31
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Pablo (itu-pablo) wrote :

Update:

Based on comments here: https://bugzilla.kernel.org/show_bug.cgi?id=206411#c12

I tried adding "options rtw88_pci disable_aspm=1" to /etc/modprobe.d/rtw88_pci.conf , which appears to solve the issue in Groovy Gorilla under 5.8.0-25-generic.

I will update if this workaround is not permanent.

Kai-Heng Feng (kaihengfeng) wrote :

Please remove "options rtw88_pci disable_aspm=1", install latest mainline kernel, and reboot twice:
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.10-rc1/amd64/

Particularly, to test "rtw88: pci: Power cycle device during shutdown".

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Pablo (itu-pablo) wrote :

Hi Feng, I was unable to try the suggested kernel as it is unsigned (and I could not find instructions on how to get an unsigned kernel to boot).

Kai-Heng Feng (kaihengfeng) wrote :

Please disable secure boot from BIOS.

Pablo (itu-pablo) wrote :

Hi, I booted by disabling secure boot as suggested and it seems to fix the wifi issue.

After disabling secure boot, I had to reboot into Windows once to get wifi working again, and then I tried rebooting into Linux a couple of times. So far wifi has worked everytime.

campus (nelucampean) wrote :

Unfortunately, kernel 5.10 rc1 doesn't fix the bug for me (Lenovo Y530-15ICH with bios version 8JCN54WW released 06/15/2020). After several reboots the network keeps disconnecting,
However the solution presented by Pablo "options rtw88_pci disable_aspm=1" works with the ubuntu stock kernel (currently 5.8.0-26)

Kai-Heng Feng (kaihengfeng) wrote :

campus, does it work but flaky? Then it sounds like a different bug.

Can you please attach dmesg under v5.10?

campus (nelucampean) wrote :

Hi, Feng
Unfortunately, in my case, wifi crashes each time (at a random period of time from boot) with kernel 5.10 rc1 and rc2 and disable_aspm removed.
The good thing is that I can use the disable_aspm workaround which makes wifi stable.
I attached the error parts from dmesg.

Kai-Heng Feng (kaihengfeng) wrote :

campus,

Can you please attach full dmesg and `sudo lspci -vvnn`?

campus (nelucampean) wrote :

Hi, Feng
I've attached full dmesg and lspci -vvnn
The bug seems to manifest when the laptop is on battery power. I've made several boot cycles this evening with kernel 5.10 rc2. When the laptop is plugged in the network works fine. when the laptop is on battery power wifi crashes.

campus (nelucampean) wrote :
Kai-Heng Feng (kaihengfeng) wrote :

Does cold boot help when it's on battery power?

campus (nelucampean) wrote :

No. cold boot does not help. I tried it several times.

Kai-Heng Feng (kaihengfeng) wrote :

Campus, can you please try this patch series:
https://patchwork.kernel.org/project/linux-pci/list/?series=369933

campus (nelucampean) wrote :

Hi, Feng
Can you, please, give me some instructions on how to download and run the code from these patches?
Thank you!

campus (nelucampean) wrote :

Hi, Feng
Tested and the error still appears. I'm starting to think it has something to do with my laptop in particular. Dmesg attached.

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-groovy' to 'verification-done-groovy'. If the problem still exists, change the tag 'verification-needed-groovy' to 'verification-failed-groovy'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-groovy
Kai-Heng Feng (kaihengfeng) wrote :

Campus,

You might need some other series like this:
https://<email address hidden>/

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.