You are not logged in.

#1 2024-12-22 11:08:49

evorster
Member
Registered: 2020-07-07
Posts: 68

[Solved] mt7921e Unable to change power state from D3cold to D0

Hi there!

My wifi card is not detected upon boot, and I can see that the kernel has issues waking it up:

[evert@Evert scripts]$ sudo dmesg | grep mt7921e
[    5.626427] mt7921e 0000:04:00.0: Unable to change power state from D3cold to D0, device inaccessible
[    6.510421] mt7921e 0000:04:00.0: driver own failed
[    6.510433] mt7921e 0000:04:00.0: probe with driver mt7921e failed with error -5

There is a workaround for this issue by just disabling powersave with pci_aspm=off, but then the battery on this laptop does not last very long and so it is not a workable workaround for me.

When booting linux-lts instead of linux kernel, this does not seem to be an issue, which to me points to a regression in the kernel.

What are the next steps in troubleshooting this issue, and where is the best place to report it?

Last edited by evorster (2025-01-19 04:56:35)

Offline

#2 2024-12-22 11:17:54

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,738
Website

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

$ modinfo -p mt7921e                                               
disable_aspm:disable PCI ASPM support (bool)
$

^ Set that to "Y": https://wiki.archlinux.org/title/Kernel … le_options


Para todos todo, para nosotros nada

Offline

#3 2024-12-22 11:34:03

evorster
Member
Registered: 2020-07-07
Posts: 68

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

Hi there!

Good guess, unfortunately no cigar. The error message has changed somewhat:

[evert@Evert ~]$ sudo dmesg | grep mt7
[    5.989852] mt7921e 0000:04:00.0: Unable to change power state from D3cold to D0, device inaccessible
[    5.989956] mt7921e 0000:04:00.0: disabling ASPM L0s L1
[    6.842429] mt7921e 0000:04:00.0: driver own failed
[    6.842439] mt7921e 0000:04:00.0: probe with driver mt7921e failed with error -5

Offline

#4 2024-12-22 14:14:20

seth
Member
Registered: 2012-09-03
Posts: 60,807

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

Welcome to the party.

https://bbs.archlinux.org/viewtopic.php?id=297178
https://bbs.archlinux.org/viewtopic.php?id=297251
https://bbs.archlinux.org/viewtopic.php?id=301691
-- also ---
https://bbs.archlinux.org/viewtopic.php?id=296954
https://bbs.archlinux.org/viewtopic.php?id=300335

tl;dr try to add "modprobe.blacklist=mt7921e" to the https://wiki.archlinux.org/title/Kernel_parameters (do NOT use the module_blacklist parameter, because we then want to…) and then explicitly load the module after the boot.
You could also try to only reload the module after the boot.

And sanity check: is there a parallel windows installation?

Offline

#5 2024-12-22 19:54:44

evorster
Member
Registered: 2020-07-07
Posts: 68

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

Hi Seth.
Many thanks for the very thorough answer.
I also reported this issue to the kernel devs, and they suggested I run a bisect to see where it all came apart.
That is likely to take some time, as I have to figure out how to do that on a kernel.

There is a windows installation, and it the wifi card there works fine.
Also, it works fine with a linux-lts kernel, so it USED to work.

Offline

#6 2024-12-22 20:28:38

seth
Member
Registered: 2012-09-03
Posts: 60,807

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

There is a windows installation, and it the wifi card there works fine.

Regardless of the LTS situation, see the 3rd link below. Mandatory.
Disable it (it's NOT the BIOS setting!) and reboot windows and linux twice for voodo reasons.

Did you test whether late loading of the module helps (ie. whether this is a race condition)?

Offline

#7 2025-01-18 10:02:36

evorster
Member
Registered: 2020-07-07
Posts: 68

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

OK, I see I have not updated this one in a while.

It seems to be specific to the linux-g14 kernel that is recommended for Asus laptops.
When running the g-14 kernel, this issue pops up, and when running vanilla linux or linux-lts, it does not pop up.
I probably should have added in this information a long time ago, but now I would like to run the g14 kernel as it has some nice patches for power control on this laptop.
Unfortunately this issue prevents me from running that kernel.

So, I'll look at the links again, and moan at the g-14 dev, because as I said, it only seems to happen on his kernel.

Offline

#8 2025-01-18 12:19:36

evorster
Member
Registered: 2020-07-07
Posts: 68

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

Hi Seth.
I see I have not even answered your questions. Must be so annoying! My apologies.

I don't hibernate this laptop in either OS, and in windows I have hibernate turned off completely with "powerctl /hibernate off"
It gives back 60+ Gb of disk space on my tiny Windows partition.

I did reboot with the modprobe.blacklist=mt7921e kernel parameter, and after a boot into the g14 kernel I did a modprobe mt7921e, and the wifi card worked!

[evert@Evert ~]$ journalctl -b | grep mt7921e
Jan 18 11:29:15 Evert.Strix kernel: Command line: BOOT_IMAGE=/vmlinuz-linux-g14 root=UUID=59749150-9abb-436a-83c5-1fb81fdf4bc7 rw amdgpu.dcdebugmask=0x10 modprobe.blacklist=mt7921e
Jan 18 11:29:15 Evert.Strix kernel: Kernel command line: ibt=off pm_debug_messages amd_pmc.dyndbg="+p" acpi.dyndbg="file drivers/acpi/x86/s2idle.c +p" BOOT_IMAGE=/vmlinuz-linux-g14 root=UUID=59749150-9abb-436a-83c5-1fb81fdf4bc7 rw amdgpu.dcdebugmask=0x10 modprobe.blacklist=mt7921e
Jan 18 11:30:12 Evert.Strix sudo[2893]:    evert : TTY=pts/1 ; PWD=/home/evert ; USER=root ; COMMAND=/usr/bin/modprobe mt7921e
Jan 18 11:30:12 Evert.Strix kernel: mt7921e 0000:04:00.0: enabling device (0000 -> 0002)
Jan 18 11:30:13 Evert.Strix kernel: mt7921e 0000:04:00.0: ASIC revision: 79220010
Jan 18 11:30:13 Evert.Strix kernel: mt7921e 0000:04:00.0: HW/SW Version: 0x8a108a10, Build Time: 20241106163228a
Jan 18 11:30:13 Evert.Strix kernel: mt7921e 0000:04:00.0: WM Firmware Version: ____000000, Build Time: 20241106163310
Jan 18 11:30:14 Evert.Strix NetworkManager[885]: <info>  [1737199814.1996] rfkill1: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:01.7/0000:04:00.0/ieee80211/phy0/rfkill1) (driver mt7921e)
Jan 18 11:30:14 Evert.Strix kernel: mt7921e 0000:04:00.0 wlp4s0: renamed from wlan0
[evert@Evert ~]$ 

What does this all mean? What are the next steps, please?

Offline

#9 2025-01-19 04:58:29

evorster
Member
Registered: 2020-07-07
Posts: 68

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

The linux-g14 from AUR is currently still applying patches for the MediaTek adapters, and this breaks the wifi card that I have.
The kernel from the g14 repo does not have the patches, and so does not break the wifi drivers.

TL;DR: Install the g14 kernel from the g14 repo.

Offline

#10 2025-01-19 15:20:39

seth
Member
Registered: 2012-09-03
Posts: 60,807

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

You shoudl probalby report that in the AUR comments.

Ftr and in case this becomes a problem down the road:

I did reboot with the modprobe.blacklist=mt7921e kernel parameter, and after a boot into the g14 kernel I did a modprobe mt7921e, and the wifi card worked!

What does this all mean? What are the next steps, please?

Likely some race condition, the next step would be to try to automatize that:
1. add the entry via modprobe.d, https://wiki.archlinux.org/title/Kernel … #blacklist (make sure to recreate the initramfs if you've the module in there)
2. see whether you get away w/ https://wiki.archlinux.org/title/Kernel_module#systemd to automatically load the module still ("later")
If not you'd have to add some systemd service that loads it after some timeout, eg. w/ an OnBoot timeout, https://wiki.archlinux.org/title/System … onic_timer

Offline

#11 2025-01-19 18:34:04

evorster
Member
Registered: 2020-07-07
Posts: 68

Re: [Solved] mt7921e Unable to change power state from D3cold to D0

Hi Seth.

Thanks for the reply. I agree with you, that seems like a logical next step to take if a proper fix was not available.
Unfortunately, modprobing the driver later did not work every time.

But, in this specific case, it is all moot because the MediaTek patches that are being applied to the AUR version should not be there in the first place.
I'll go report it on the proper place.

Thanks again for taking a look, and for the very good advice.

Offline

Board footer

Powered by FluxBB