lwfinger/rtw89

8852be error

satishwagh opened this issue · 25 comments

Following error came when compiled against 6.1.x LTS kernel.

rtw89_8852be 0000:57:00.0: MAC has already powered on
rtw89_8852be 0000:57:00.0: [ERR]pci config read 719
rtw89_8852be 0000:57:00.0: [ERR] pcie autok fail -22
rtw89_8852be 0000:57:00.0: failed to setup chip information
rtw89_8852be: probe of 0000:57:00.0 failed with error -22

I even replaced the 6.2.10 stable kernel's rtw89 directory into 6.1.23 kernel directory. Compiled it successfully but it throws same error as mentioned above.

What version of the firmware do you have? You did not include that part of the dmesg output.

What version of the firmware do you have? You did not include that part of the dmesg output.

I am using the latest version of firmware. As I am away from computer now, hence can not paste the dmesg output. But the firmware version I'm using is latest one.

After posting the issue, I compiled latest stable kernel 6.2.10 and found the same issue with it.
But if I install Ubuntu 23.04, then there is no problem with RTL8852be wireless device. It works flawlessly.

There was a problem with the firmware. An update to the firmware failed to work with older code.

The md5sum for /lib/firmware/rtw89/ should contain 2 of the following:
97cc27ddbaacfcfd9f4b4ad425d114d3 /lib/firmware/rtw89/rtw8852b_fw-1.bin
a9a8ce70a7a8c209fe13f2a1e24a6685 /lib/firmware/rtw89/rtw8852b_fw-1.bin.xz
a3317e9646c8e669c7c2d1fc19a6109d /lib/firmware/rtw89/rtw8852b_fw.bin
6c91e2112e09b7313cee17f884fd4f70 /lib/firmware/rtw89/rtw8852b_fw.bin.xz

The .xz files were provided by my distro. The other 2 came from the linux-firmware repository. The ones with "-1" are the newer firmware.

From where I can download these xz files?

Those xz files are supplied by my distro. They are available for openSUSE users, the way they should for all distros. Unfortunately, some are brain-dead.

You can get the nonn-compressed versions by cloning the git repo at git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git. That will get all of the kernel firmware.

I downloaded said firmware but still same error.
I had tried various firmware.

Firmware versions of rtw8852b_fw-1.bin as:
0.29.29.1
0.29.29.0
0.29.26.0

Firmware versions of rtw8852b_fw.bin as:
0.27.32.1
0.27.32.0

No matter which firmware I used, it throws same error every time.

Attach your complete dmesg output.

Attach your complete dmesg output.

dmesg.txt

Thanks. Unfortunately, I see nothing wrong there.

You say that Ubuntu 23.04 works. What version are you running?

I see bunch of errors in dmesg. Those messages are mentioned in first post itself.

I am not sure about the version you are asking.
I checked with Ubuntu 23.04 desktop edition. I even copied the Ubuntu 23.04's firmware onto my machine but got the same result.

What I meant is that I saw nothing new.

Two days ago, you said that "Ubuntu 23.04 is working flawlessly." What version/distro is failing? I am confused!!

Oh Sorry! My bad.

I am having my own custom Linux distribution based upon LFS.
It does have custom compiled kernel. Kernel version I tried so far for this issue are from 6.1.15 till 6.1.23 and 6.2.10.

For cross checking, I booted with Ubuntu-23.04 on same hardware and found that 8852be device works perfectly fine with Ubuntu. So I copied the /lib/firmware/rtw89 directory from Ubuntu and replaced it with my custom OS at /lib/firmware/rtw89. But still the 8852be device fails to work.

I now understand more. I have never seen that kind of problem with any kernel using an openSUSE distro. Obviously, Ubuntu works as well as dose Fedora.

My only conclusion is that you have some problem with the PCI subsystem with your version of LFS. If testing here could be accomplished with downloading and installing a standard distro, I could do that, but I am not prepared to build my complete system as would be required. I do not think there is anything else I can do. You have found one of the huge downsides of building your own. When one of the major distros builds a system, it gets lots of testing before it is released. It may take some time before the latest software gets released, but I find that a reasonable tradeoff. Besides, I run openSUSE Tumbleweed, which is a rolling release. It has a 6.2.x kernel, gcc v13, and a lot of other cutting-edge software. The only thing I build is a kernel, because I want to test the latest kernel HEAD - 6.3.0-rc6 at the moment.

One more thing: on the same hardware, with the same custom OS, if I switch to customly build 5.15.73 LTS kernel then this 8852be works smooth. Just because I had upgraded kernel to 6.x, this problem occurs.
Please note that I used the same .config file for both 5.x and 6.x kernel

Well, if you can use the kernel git repo, and bisect the problem, then I might be able to help. You had to have changed the .config file as there are a lot of things that change.

Use 'lsmod | grep rtw' to ensure that you are not getting a conflict between the code in this repo, and the code in the kernel.

Yes I've taken care of that. There is no single module in kernel which starts with rtw.
All related kernel module are compiled from rtw89 git repo only.
For 6.2.10 kernel, I had tried two approach.
First: I deselected rtw89 from kernel tree and compiled rtw89 git repo.
Second: I selected the rtw89 modules from kernel tree. No external module involved.

In both approach, I got the same result as stated in first post.
Is there any specific configuration in kernel 6.x which might be affecting and causing this error?

New updates were merged into wireless-next today. I added them to this repo and pushed the new code.

I just booted kernel 6.2.10 fron openSUSE today, and the in-kernel 8852be driver works fine. If you were missing a kernel feature, I would expect a buidl or module loading problem. For guidance, I have attached my kernel configuration file. Depending on your hardware, it may not boot as I have trimmed a lot of features and drivers.
config.txt

sudo dmesg | grep rtw
[    3.157597] rtw89_8852be 0000:09:00.0: loaded firmware rtw89/rtw8852b_fw-1.bin
[    3.157852] rtw89_8852be 0000:09:00.0: enabling device (0000 -> 0003)
[    3.159296] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.3 (91835e0f), cmd version 0, type 5
[    3.159299] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.3 (91835e0f), cmd version 0, type 3
[    3.159305] rtw89_8852be 0000:09:00.0: MAC has already powered on
[    3.165011] rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
[    3.165016] rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
[    3.165020] rtw89_8852be 0000:09:00.0: failed to setup chip information
[    3.166179] rtw89_8852be: probe of 0000:09:00.0 failed with error -22

I downloaded the latest firmware from here:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtw89
but I got this error:

[    3.210042] rtw89_8852be 0000:09:00.0: loaded firmware rtw89/rtw8852b_fw-1.bin
[    3.210309] rtw89_8852be 0000:09:00.0: enabling device (0000 -> 0003)
[    3.211636] rtw89_8852be 0000:09:00.0: Unknown firmware header version 10
[    3.211642] rtw89_8852be 0000:09:00.0: failed to recognize firmware
[    3.211643] rtw89_8852be 0000:09:00.0: failed to setup chip information
[    3.212687] rtw89_8852be: probe of 0000:09:00.0 failed with error -2

I am using a Lenovo LOQ with Ubuntu 22.04 kernel 6.2.0-37-generic
Please advise @lwfinger

You have a faulty version of the firmware.Run the command 'md5sum /lib/firmware/rtw89/*'. The correct result should be
4df8d6e2459b9409837f64a4be879288 /lib/firmware/rtw89/rtw8852b_fw-1.bin

The firmware is reported as
[ 6.935970] rtw89_8852be 0000:02:00.0: Firmware version 0.29.29.5 (da87cccd), cmd version 0, type 5
[ 6.935977] rtw89_8852be 0000:02:00.0: Firmware version 0.29.29.5 (da87cccd), cmd version 0, type 3

Where can I locate the right firmware version?

You should read the last sentence of README.md.

I re-downloaded the faulty firmware.
dmesg shows that the latest firmware is detected but still receiving an error:

[  134.969627] rtw89_8852be 0000:09:00.0: loaded firmware rtw89/rtw8852b_fw-1.bin
[  134.970029] rtw89_8852be 0000:09:00.0: enabling device (0000 -> 0003)
[  134.972313] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd version 0, type 5
[  134.972317] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd version 0, type 3
[  134.972331] rtw89_8852be 0000:09:00.0: MAC has already powered on
[  134.978068] rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
[  134.978070] rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
[  134.978071] rtw89_8852be 0000:09:00.0: failed to setup chip information
[  134.978882] rtw89_8852be: probe of 0000:09:00.0 failed with error -22

lspci -v output:

Network controller: Realtek Semiconductor Co., Ltd. Device b852
	Subsystem: Lenovo Device 4853
	Flags: fast devsel, IRQ 17
	I/O ports at 3000 [size=256]
	Memory at 52100000 (64-bit, non-prefetchable) [size=1M]
	Capabilities: <access denied>
	Kernel modules: wl, rtw_8852be

I am suspiciousof the Lenovo BIOS . Create an options file using the following command:

sudo nano /etc/modprobe.d/70-rtw8852be.conf

Add the following 2 lines to that file:

options rtw89pci disable_aspm_l1=y disable_aspm_l1ss=y
options rtw89_pci disable_aspm_l1=y disable_aspm_l1ss=y

You can test whenther you got the file correctly entered with

sudo modprobe -rv rtw_8852be
sudo modprobe -v rtw_8852be

The output of the second command should show the disable_aspm... options appended to the rtw89pci load line.

If this does not help, you will need to post your problem on the linux-wireless mailing list linux-wireless@vger.kernel.org.

right, this is the output when adding the module:

insmod /lib/modules/6.2.0-37-generic/kernel/lib/crypto/libarc4.ko 
insmod /lib/modules/6.2.0-37-generic/kernel/net/mac80211/mac80211.ko 
insmod /lib/modules/6.2.0-37-generic/kernel/drivers/net/wireless/realtek/rtw89/rtw89core.ko 
insmod /lib/modules/6.2.0-37-generic/kernel/drivers/net/wireless/realtek/rtw89/rtw89pci.ko disable_aspm_l1=y disable_aspm_l1ss=y 
insmod /lib/modules/6.2.0-37-generic/kernel/drivers/net/wireless/realtek/rtw89/rtw_8852b.ko 
insmod /lib/modules/6.2.0-37-generic/kernel/drivers/net/wireless/realtek/rtw89/rtw_8852be.ko

but dmseg output did not change:

[  188.333979] rtw89_8852be 0000:09:00.0: loaded firmware rtw89/rtw8852b_fw-1.bin
[  188.335858] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd version 0, type 5
[  188.335861] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd version 0, type 3
[  188.335867] rtw89_8852be 0000:09:00.0: MAC has already powered on
[  188.341597] rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
[  188.341599] rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
[  188.341600] rtw89_8852be 0000:09:00.0: failed to setup chip information
[  188.342425] rtw89_8852be: probe of 0000:09:00.0 failed with error -22

Sent to the linux-wireless mailing list if you would like to add some more details:
https://marc.info/?l=linux-wireless&m=170094816626424&w=2