Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firmware failed to leave lps state #61

Open
pooh2pooh opened this issue Jun 30, 2021 · 27 comments
Open

firmware failed to leave lps state #61

pooh2pooh opened this issue Jun 30, 2021 · 27 comments

Comments

@pooh2pooh
Copy link

pooh2pooh commented Jun 30, 2021

Hi! The following errors constantly appear in the log. The WiFi connection is stable at the same time.

июн 30 19:39:31 not-a-virus kernel: rtw_8822ce 0000:01:00.0: failed to send h2c command
июн 30 19:39:31 not-a-virus kernel: rtw_8822ce 0000:01:00.0: failed to send h2c command
июн 30 19:39:31 not-a-virus kernel: rtw_8822ce 0000:01:00.0: failed to send h2c command
июн 30 19:39:31 not-a-virus kernel: rtw_8822ce 0000:01:00.0: failed to send h2c command
июн 30 19:39:31 not-a-virus kernel: rtw_8822ce 0000:01:00.0: failed to send h2c command
июн 30 19:39:31 not-a-virus kernel: rtw_8822ce 0000:01:00.0: failed to send h2c command
июн 30 19:39:31 not-a-virus kernel: rtw_8822ce 0000:01:00.0: firmware failed to leave lps state

lspci -v

01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter
	Subsystem: Electronics & Telecommunications RSH Device 1e25
	Physical Slot: 0
	Flags: bus master, fast devsel, latency 0, IRQ 75, IOMMU group 7
	I/O ports at 2000 [size=256]
	Memory at c0700000 (64-bit, non-prefetchable) [size=64K]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [148] Device Serial Number 00-e0-4c-ff-fe-c8-22-01
	Capabilities: [158] Latency Tolerance Reporting
	Capabilities: [160] L1 PM Substates
	Kernel driver in use: rtw_8822ce
	Kernel modules: rtw88_8822ce, rtw_8822ce

image

@Fak3
Copy link

Fak3 commented Jan 14, 2022

I can confirm this bug on my lenovo laptop, 5.16.0 kernel

04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter
        Subsystem: Lenovo Device c123
        Flags: bus master, fast devsel, latency 0, IRQ 79, IOMMU group 12
        I/O ports at 2000 [size=256]
        Memory at c3600000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [148] Device Serial Number 00-e0-4c-ff-fe-c8-22-01
        Capabilities: [158] Latency Tolerance Reporting
        Capabilities: [160] L1 PM Substates
        Kernel driver in use: rtw_8822ce
        Kernel modules: rtw88_8822ce

i tried to add options rtw88_pci disable_aspm=1 to my /etc/modprobe.d/local.conf but still have my system journal and dmesg flooded with errors

[    3.516129] rtw_8822ce 0000:04:00.0: enabling device (0000 -> 0003)
[    3.523097] rtw_8822ce 0000:04:00.0: Firmware version 9.9.4, H2C version 15
[    3.530951] rtw_8822ce 0000:04:00.0: Firmware version 9.9.10, H2C version 15
[    3.999011] rtw_8822ce 0000:04:00.0 wlp4s0: renamed from wlan0
[    5.324088] rtw_8822ce 0000:04:00.0: start vif dc:e9:94:7e:5f:85 on port 0
[    5.325431] rtw_8822ce 0000:04:00.0: stop vif dc:e9:94:7e:5f:85 on port 0
[    5.561473] rtw_8822ce 0000:04:00.0: start vif ee:c7:7c:0e:6b:3c on port 0
[    9.847260] rtw_8822ce 0000:04:00.0: stop vif ee:c7:7c:0e:6b:3c on port 0
[   10.085443] rtw_8822ce 0000:04:00.0: start vif dc:e9:94:7e:5f:85 on port 0
[   14.738024] rtw_8822ce 0000:04:00.0: sta 10:fe:ed:51:2a:94 joined with macid 0
[   49.030634] rtw_8822ce 0000:04:00.0: firmware failed to leave lps state
[   49.033828] rtw_8822ce 0000:04:00.0: failed to send h2c command
[   49.036994] rtw_8822ce 0000:04:00.0: failed to send h2c command

any solution?

@Fak3
Copy link

Fak3 commented Jan 15, 2022

Update: the message flood only happens when laptop charger is not connected.

  1. I connected the charger. The "firmware failed to leave lps state" message stopped to appear, but "failed to send h2c command" message still continuously flooded my dmesg
  2. I put laptop to sleep, then wake up. Message flood stopped.
  3. I disconnected the charger, and after few minutes message started to come in again.

@Fak3
Copy link

Fak3 commented Jan 15, 2022

FWIW I have reported issue here as well: https://bugzilla.kernel.org/show_bug.cgi?id=215496

@lwfinger
Copy link
Owner

Surprisingly, almost no one pays any attention to the kernel bugzilla, which is why the README.md tells you how to file bug information.

If it happens only when the charger is not connected, then I suspect that your laptop has an internal voltage problem. The voltage supplied to the power regulators will be somewhat higher when plugged into power than when operating on the battery. Can you contact your laptop supplier? Perhaps there is a recall, or a BIOS update to handle this issue.

@pooh2pooh
Copy link
Author

pooh2pooh commented Jan 15, 2022

This is more like incorrect management of the device's power saving.

I managed to fix it. But I don't remember exactly how. If I remember, I'll tell you about it.

I contacted the kernel developers, they pointed in the right direction.

@Fak3
Copy link

Fak3 commented Jan 18, 2022

@pooh2pooh do you use bluetooth devices by any chance?

@pooh2pooh
Copy link
Author

@pooh2pooh do you use bluetooth devices by any chance?

yes. bluetooth mouse and headphones

@rilwansmith
Copy link

rilwansmith commented Jan 27, 2022

This is more like incorrect management of the device's power saving.

I managed to fix it. But I don't remember exactly how. If I remember, I'll tell you about it.

I contacted the kernel developers, they pointed in the right direction.

I'm interested in the fix because this same problem is occurring on my KDE NEON HP laptop

@lwfinger
Copy link
Owner

My best guess would be to set "disable_lps_deep=y" option for rtw88_core.

@rilwansmith
Copy link

rilwansmith commented Jan 28, 2022

I solved this problem by permanently disabling the power_save feature also known as power management for the wireless interface of my KDE NEON HP Laptop.
Use a text editor to open the file /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
Replace the content of the file with the below text.

[connection]
wifi.powersave = 2

Then reboot your computer.
Problem solved.

@Fak3
Copy link

Fak3 commented Jan 28, 2022

@rilwansmith do you use Bluetooth mouse by any chance? Trying to figure out if it is relevant.

@rilwansmith
Copy link

No

@rilwansmith do you use Bluetooth mouse by any chance? Trying to figure out if it is relevant.

No.

@Beyley
Copy link

Beyley commented Feb 28, 2022

My best guess would be to set "disable_lps_deep=y" option for rtw88_core.

Im getting this issue on my Asus VivaBook 17, where would i put this option?
dmesg log
im not exactly sure its the same issue but it seems to be, wifi will work for a few mins then just break until i restart, which then it will work for a few then break

@lwfinger
Copy link
Owner

Like all module options, you need to create (as root) a file /etc/modules.d/50-rtw88.conf. In this file, add a single line that says "options rtw88_core disable_lps_deep=y" and reboot.

@Beyley
Copy link

Beyley commented Mar 1, 2022

Like all module options, you need to create (as root) a file /etc/modules.d/50-rtw88.conf. In this file, add a single line that says "options rtw88_core disable_lps_deep=y" and reboot.

I tried that and sadly i get the exact same issue, no change on dmesg either

@lwfinger
Copy link
Owner

lwfinger commented Mar 1, 2022

Actually, the above line is for the in-kernel driver. To use this one, the line should be 'options rtw_core disable_lps_deep=y'

You can check that you got it correctly by the following:

sudo modprobe -rv rtw_8821ce
sudo modprobe -v rtw_8821ce

You should see the option on the rtw_core line for the second command.

@Beyley
Copy link

Beyley commented Mar 1, 2022

Actually, the above line is for the in-kernel driver. To use this one, the line should be 'options rtw_core disable_lps_deep=y'

You can check that you got it correctly by the following:

sudo modprobe -rv rtw_8821ce sudo modprobe -v rtw_8821ce

You should see the option on the rtw_core line for the second command.

I see the option on the second command, yet still the same issue and no change to dmesg output

@lwfinger
Copy link
Owner

lwfinger commented Mar 1, 2022

Which driiver are you using - in-kernel or from repo?

@Beyley
Copy link

Beyley commented Mar 1, 2022

Which driiver are you using - in-kernel or from repo?

Ive tried both (exact same issue), currently the one in the repo should be the one in use

@lwfinger
Copy link
Owner

lwfinger commented Mar 1, 2022

There are two rtw_pci options to try, namely "disable_msi=y" and "disable_aspm=y". add a second line to your options file that says

options rtw_pci disable_msi=y disable_aspm=y

@Beyley
Copy link

Beyley commented Mar 1, 2022

same problem, heres the dmesg log grepped to rtw

@FOSSBOSS
Copy link

FOSSBOSS commented May 8, 2023

what is lps anyway?
is that "low power"?
I see this message when im out in the yard with my laptop, but not when I'm indoors near the wifi router. might it be signal power related?

@lwfinger
Copy link
Owner

lwfinger commented May 9, 2023

I think lps means low power state. Your observations indicate that it is related to the signal strength.

What device do you have? Repo rtw88 now drives 12 different ones - each with their pecularities.

@FavoritoHJS
Copy link

FavoritoHJS commented Dec 25, 2023

bump, have a RTL8822BE adapter with this issue - after a few minutes a rtw_8822be 0000:06:00.0: firmware failed to leave lps state appears in the journal every minute and a half.
tried setting kernel options and disabling powersave on networkmanager, neither worked... on 2,4GHz.
on 5GHz i had 0 journal spam for multiple hours. Interesting... EDIT 02-02-24 Not anymore! appears this was just coincidence.
unsure if this is just luck or a potential hint.
ps: issue might be related to #82

@tortured1
Copy link

I'm setting up a new HP laptop with Fedora 39. The rtw88_882ce driver built in to the 6.5.6-300.fc39.x86_64 kernel works just fine. The problem comes in when I update the laptop, and the kernel gets updated to 6.7.4-200.fc39, and I install and use Cinnamon as my desktop.

Under Cinnamon, I get a bunch of different errors with the rtw_882ce driver like "device [10ec:c822] error status/mask=00004000/004000000]" and then the "firmware failed to leave lps state" and "failed to send h2c command" errors.

To recap all of the suggestions made in this thread...

I tried creating /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and putting this in the file:

[connection]
wifi.powersave = 2

I even tried adding the "wifi.powersave=2" into the connection entry in /etc/NetworkManager/system-connections/mynetwork.nmconnection file. No go.

My plan was to create /etc/modules.d/50-rtw88.conf, and put the following in there, HOWEVER, /etc/modules.d doesn't exist in Fedora 39.

options rtw88_core disable_lps_deep=y
options rtw88_pci disable_msi=y disable_aspm=y
options rtw_core disable_lps_deep=y
options rtw_pci disable_msi=y disable_aspm=y

There seemed to be two different versions of things, one with the 88 and one without, I figured I'd put them both in there. I'm unsure of where to actually put these on my system, though.

It didn't make any difference if the laptop was plugged in or not. I could watch the connection bounce up and down.

The really strange part is that the network connection is fine if I go back to GNOME, and I don't get any of those errors.

What desktop are other people having this problem using?

@lwfinger
Copy link
Owner

rtw88_882ce is not a valid driver name. I guess it is an 8822ce and the driver is rtw88_8822ce.

The difference in the names in the options file is that one set is for the kernel drivers, and one is for this repo.

I just upgraded a Fedora 38 virtual machine to Fedora 39. The directory /etc/modprobe.d/ is still there. You are putting the options file in the wrong place.

I generally use either the KDE desktop, or xFce if I want a lighter weight desktop. The difference between desktops is that the user-space code to support wifi devices is different. If you use NetworkManager in each, there should not be much difference.

@tortured1
Copy link

Obsv, that was a transcription error, as I couldn't copy/paste the errors without a network connection. Absolutely a catch-22 situation, yes.

As far as I can tell, both desktops are using the same NetworkManager. It's very odd.

As you pointed out, there is an /etc/modprobe.d, but the advice given earlier was to put it into a file in /etc/modules.d, which doesn't exist. Putting the options into /etc/modprobe.d/rtw_8822ce.conf (or local.conf, which I did first, but decided to give it a more meaningful name) did work.

Also, FWIW, I had left out the disable_msi=y the first time through, and things didn't work, but after I added it, it did. I didn't try other permutations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants