On resume from suspend, sys-net would show a page allocation failure
and CPU Tainted: G
dmesg prior to fix
[ 1067.807736] mt7921e 0000:00:07.0: ASIC revision: 79220010
[ 1067.892557] mt7921e 0000:00:07.0: HW/SW Version: 0x8a108a10, Build Time: 20231120183400a
[ 1067.919520] mt7921e 0000:00:07.0: WM Firmware Version: ____000000, Build Time: 20231120183441
[ 1067.978287] kworker/0:1: page allocation failure: order:5, mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0
[ 1067.978318] CPU: 0 PID: 1910 Comm: kworker/0:1 Tainted: G W 6.1.62-1.qubes.fc37.x86_64 #1
[ 1067.978328] Hardware name: Xen HVM domU, BIOS 4.17.2 01/03/2024
[ 1067.978336] Workqueue: events mt7921_init_work [mt7921_common]
[ 1067.978350] Call Trace:
[ 1067.978356] <TASK>
Fix
sudo rmmod mt7921e
sudo modprobe mt7921e
Fixes the problem.
As suggested by Suspend/resume troubleshooting, I did
echo "mt7921e" >> /rw/config/suspend-module-blacklist
Then I suspended and resumed, but WiFi doesn’t work. dmesg has the same error as before, followed by:
mt7921e 0000:00:07.0: register device failed
I tried,
sudo rmmod mt7921e
but this resulted in sys-net crashing. I repeated this with the same effect.
I tried suspend again, and this time ran:
sudo modprobe mt7921e
sudo rmmod mt7921e
sudo modprobe mt7921e
And it worked. I repeated that and it worked again.
Ultimately, I ended up removing mt7921e
in /rw/config/suspend-module-blacklist
and instead implementing this behavior manually:
Automated fix
/rw/config/qubes-bind-dirs.d/50_user.conf
binds+= ( '/etc/pm/sleep.d' )
/rw/bind-dirs/etc/pm/sleep.d/restart-network.sh
#!/bin/sh
case "${1}" in
suspend|hibernate)
sudo rmmod mt7921e
;;
resume|thaw)
sudo modprobe mt7921e
;;
esac
This ran into a lot of issues, so I fell back to just manually running sudo rmmod mt7921e && sleep 0.5 && sudo modprobe mt7921e