mt7921e wifi fails to resume after suspend

Bug #1975444 reported by David Soles
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
New
Undecided
Unassigned

Bug Description

After resuming my suspended PC, the wifi becomes unresponsive. The only way to get it working again is to do a full reboot. I'm using Ubuntu 22.04 LTS Jammy and my wifi card is:

MEDIATEK Corp. MT7921K (RZ608) Wi-Fi 6E 80MHz using `mt7921e` driver.

This is what I can see in the logs:

kernel: mt7921e 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
kernel: mt7921e 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
kernel: mt7921e 0000:02:00.0: chip reset
kernel: mt7921e 0000:02:00.0: Message 0000004e (seq 7) timeout
kernel: mt7921e 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
kernel: mt7921e 0000:02:00.0: chip reset failed
kernel: mt7921e 0000:02:00.0: Failed to get patch semaphore
kernel: mt7921e 0000:02:00.0: Message 80000010 (seq 4) timeout
kernel: mt7921e 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT
kernel: mt7921e 0000:02:00.0: chip reset failed
kernel: mt7921e 0000:02:00.0: Failed to get patch semaphore
kernel: mt7921e 0000:02:00.0: Message 80000010 (seq 12) timeout
kernel: mt7921e 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
kernel: mt7921e 0000:02:00.0: Failed to get patch semaphore
kernel: mt7921e 0000:02:00.0: Message 80000010 (seq 11) timeout
kernel: mt7921e 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
kernel: mt7921e 0000:02:00.0: Failed to get patch semaphore
kernel: mt7921e 0000:02:00.0: Message 80000010 (seq 10) timeout
kernel: mt7921e 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
kernel: mt7921e 0000:02:00.0: Failed to get patch semaphore
kernel: mt7921e 0000:02:00.0: Message 80000010 (seq 9) timeout
kernel: mt7921_start+0x25/0x70 [mt7921e]
kernel: mt7921e 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
kernel: PM: pci_legacy_suspend(): mt7921_pci_suspend+0x0/0x340 [mt7921e] returns -110
kernel: mt7921e 0000:02:00.0: Message 40000007 (seq 2) timeout
kernel: mt7921_poll_rx+0x4f/0xe0 [mt7921e]
kernel: mt7921e 0000:02:00.0 wlp2s0: renamed from wlan0
NetworkManager: <info> [1653237444.7259] rfkill1: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/ieee80211/phy0/rfkill1) (driver mt7921e)
kernel: mt7921e 0000:02:00.0: Firmware init done
kernel: mt7921_pci_driver_init+0x23/0x1000 [mt7921e]
kernel: mt7921e 0000:02:00.0: ASIC revision: 79610010

I really appreciate someone's help to fix this behaviour.
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: dsoles 1932 F.... pulseaudio
 /dev/snd/controlC0: dsoles 1932 F.... pulseaudio
CRDA: N/A
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 22.04
InstallationDate: Installed on 2022-05-07 (16 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
MachineType: AZW SER
Package: linux (not installed)
ProcFB: 0 amdgpudrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.15.0-30-generic root=UUID=212b8944-a42a-41d8-add0-95aa98d374fb ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 5.15.0-30.31-generic 5.15.30
RelatedPackageVersions:
 linux-restricted-modules-5.15.0-30-generic N/A
 linux-backports-modules-5.15.0-30-generic N/A
 linux-firmware 20220329.git681281e4-0ubuntu3
Tags: jammy wayland-session
Uname: Linux 5.15.0-30-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip docker lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 01/21/2022
dmi.bios.release: 5.16
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: SER_V1.08_P3C6M43_B_Link
dmi.board.asset.tag: Default string
dmi.board.name: SER
dmi.board.vendor: AZW
dmi.board.version: V01
dmi.chassis.asset.tag: Default string
dmi.chassis.type: 35
dmi.chassis.vendor: AZW
dmi.chassis.version: Default string
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrSER_V1.08_P3C6M43_B_Link:bd01/21/2022:br5.16:svnAZW:pnSER:pvrDefaultstring:rvnAZW:rnSER:rvrV01:cvnAZW:ct35:cvrDefaultstring:skuSKU4:
dmi.product.family: SER
dmi.product.name: SER
dmi.product.sku: SKU4
dmi.product.version: Default string
dmi.sys.vendor: AZW

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Libera.chat.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1975444/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → linux (Ubuntu)
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1975444

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
David Soles (davidsoles) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected jammy wayland-session
description: updated
Revision history for this message
David Soles (davidsoles) wrote : CurrentDmesg.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : IwConfig.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : Lspci.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : Lspci-vt.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : Lsusb.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : Lsusb-t.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : Lsusb-v.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : PaInfo.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : ProcEnviron.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : ProcInterrupts.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : ProcModules.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : PulseList.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : RfKill.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : UdevDb.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : WifiSyslog.txt

apport information

Revision history for this message
David Soles (davidsoles) wrote : acpidump.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please let the system suspend/resume, then attach dmesg here.

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
David Soles (davidsoles) wrote (last edit ): Re: [Bug 1975444] Re: mt7921e wifi fails to resume after suspend

Here is the dmesg command output after suspend/resume.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

[ 63.782837] mt7921e 0000:02:00.0: can't change power state from D3cold to D0 (config space inaccessible)

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Revision history for this message
David Soles (davidsoles) wrote :

I followed your suggestion of using kernel v5.18 and no luck :-(

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Can you please attach dmesg under v5.18?

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please give this patch a try.

tags: added: patch
Revision history for this message
Alfonso Zamora (aazamora) wrote :

Same problem here. I installed Ubuntu 22.04 on Asus Vivobook and the WiFi card not work after suspend the laptop.

lspci -v command ouptup:

0000:2e:00.0 Network controller: MEDIATEK Corp. MT7921 802.11ax PCI Express Wireless Network Adapter
 DeviceName: WLAN
 Subsystem: AzureWave Device 4680
 Flags: bus master, fast devsel, latency 0, IRQ 175, IOMMU group 17
 Memory at 612c100000 (64-bit, prefetchable) [size=1M]
 Memory at 612c200000 (64-bit, prefetchable) [size=16K]
 Memory at 612c204000 (64-bit, prefetchable) [size=4K]
 Capabilities: <access denied>
 Kernel driver in use: mt7921e
 Kernel modules: mt7921e

Revision history for this message
Alfonso Zamora (aazamora) wrote :

I have opened a new bug (following suggestions from apport) that is related to this bug at:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1980701

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Maybe give the patch I attached in LP: #1980701 a try?

Revision history for this message
Alfonso Zamora (aazamora) wrote :

Hello,

I don't see any patches on that LP. Here I do see a patch attached. How could I test it?

Thanks.

Revision history for this message
Alfonso Zamora (aazamora) wrote :

Hello,

I don't see any patches on that LP. Here I do see a patch attached. How could I test it?

Thanks!

Revision history for this message
P.Constantine (pconstantine) wrote :

Works fine for me on 5.18
But it is pain in the ass to keep mainline kernel working. Hibernation and other systemd integrations don't work.

Revision history for this message
Alfonso Zamora (aazamora) wrote :

Hi Kai-Heng Feng,

I have tested your patch by compiling Ubuntu Kinetic kernel 5.19 (22.10).

Unfortunately, the problem still occurs.

Any idea or solution? I see that there are similar problems with this driver whose "fix" has already been released by Canonical, but the problem persists...

After doing a dmesg:

[ 81.213735] mt7921e 0000:2e:00.0: Unable to change power state from D3cold to D0, device inaccessible
[ 82.498484] mt7921e 0000:2e:00.0: driver own failed
[ 82.498491] mt7921e 0000:2e:00.0: PM: dpm_run_callback(): pci_pm_resume+0x0/0x100 returns -5
[ 82.498497] mt7921e 0000:2e:00.0: PM: failed to resume async: error -5
[ 82.498501] mt7921e 0000:2e:00.0: chip reset

(There seems to be another similar bug, which is the one that is fixed, with async error -110)

https://bugs.launchpad.net/hwe-next/+bug/1958286

Thanks.

Revision history for this message
Renata Lei (renataa-l) wrote :

Hello!
I'm facing the same issue. I've never patched a kernel. Could someone provide me some detailed instructions on how to do it?

Thanks.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Does the issue still happen on v6.0?

Revision history for this message
Deyl (mrdeyl) wrote :

Hello. I got the same issue, 6.0.0-0.rc7 doesn't solve the issue. By the way I tried Fedora 36 and recent Manjaro, the same problem everywhere. On older 5.15 kernel wifi doesn't appear to work but suspension functions well.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Revision history for this message
gugaiz (gugaiz) wrote :

I have the same problem with MediaTek Corp. MT7922 on kernel 6.2.0-20-generic #20-Ubuntu. Wifi works fine after a reboot, but it does not start after resuming. I can't even do sudo commands after resuming and the computer won't turn off (I have to turn it off by pressing and holding the power button)

Attached dmesg output after resuming

Revision history for this message
gugaiz (gugaiz) wrote :

For those looking for a solution, I solved the problem on a Vivobook_ASUSLaptop K6501ZM_K6501ZM/K6501ZM, BIOS K6501ZM.204 by using Ubuntu 23.04 kernel 6.2.0-20-generic and set the mem_sleep_default kernel parameter to 'deep'

Revision history for this message
Doki (lkishalmi) wrote :

It happens from time to time with my Dell Inspiron as well (I happen to have 5425, 7425 and 5625 models)

The mt7921e module reload seems to fix the issue.

I've created a root owned executable file at /usr/lib/systemd/system-sleep/mt-wifi for it as

#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin

if [ "$1" = "post" ]; then
    modprobe mt7921e
elif [ "$1" = "pre" ]; then
    modprobe -r mt7921e
fi
exit 0

Revision history for this message
fv (fratiman-vladut) wrote :

Hi!
I have an asus vivobook pro15 with mt7921e running kernel 6.2.0-39-generic.

I tried all possible solutions over time, nothing worked. Today, I found somewhere a suggestion to use the following sequence as a kernel parameter: mem_sleep_default=deep.
After the reboot, I was able to put the computer to sleep, then resume and the wifi worked without any problem.
Try this solution, for me worked, at least for moment.

Revision history for this message
vadim (vadim1337) wrote :
Revision history for this message
vadim (vadim1337) wrote :
Revision history for this message
Pavel Petrovic (pavel-petrovic) wrote :

This still happens on brand new ASUS Vivobook and Ubuntu 24.04.1.
This bug is very annoying and apparently has not been fixed.

Changed in linux (Ubuntu):
status: Expired → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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