[RESPONDED] Yet more Mediatek issues on AMD/Linux

I’ve been struggling with the Mediatek wifi card for at least a month.

  • On a fresh boot, it takes 1-2 minutes before the card is recognized and I have access to wi-fi.
  • On reboot or suspend it usually comes up immediately.
  • On hibernate it sometimes comes up after I put the system into airplane mode, then take it out of airplane mode, but only if bluetooth is turned on. Sometimes it refuses to come up at all.

I’m running Manjaro GNOME (kernel 6.8.5-1), but got fed up enough that I installed a dual-boot with Ubuntu 24.04 (default kernel), which behaves as follows:

  • Always works immediately on fresh boot or reboot.
  • Sometimes works after hibernate, sometimes doesn’t.

On Manjaro after fresh boot, I get many copies of the following message in the log until it eventually works:

mt7921e 0000:01:00.0: not ready 1023ms after FLR; waiting

On both Manjaro and Ubuntu, I see many copies of the following when it fails after Hibernation:

mt7921e 0000:01:00.0: Message 00000010 (seq 9) timeout
mt7921e 0000:01:00.0: Failed to get patch semaphore

It would be really nice if my wifi worked consistently. Otherwise makes the laptop difficult to use. I’ve seen posts for this problem under Arch, but not yet seen a consistent solution.

Info:
BIOS 3.05

I’m currently in Manjaro, but I’ll be happy to debug from Ubuntu since it will make y’all happier.

[    2.449163] mt7921e 0000:01:00.0: ASIC revision: 79220010
[    2.532894] mt7921e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20231120183400a
[    2.548108] mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20231120183441

sudo lspci -k
01:00.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter
	Subsystem: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter
	Kernel driver in use: mt7921e
	Kernel modules: mt7921e

1 Like

Fedora 39 here, seems to be on newer firmware:

Apr 29 08:56:57 kernel: mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20240219103337

Based on the reported timestamps, there’s one or two WiFi (and BT) firmware updates Manjaro hasn’t shipped yet.

1 Like

Darn. Maybe I should have installed Fedora instead of Ubuntu. I’ll put that on my list for when I have some time.

I have similar issues on the latest Opensuse Tumbleweed and the latest bios (on a FW16). It looks like the build time is more recent unless I am reading it wrong:

[ 1573.233508] mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20240409163347

Yeah that looks newer than what I have on Fedora. Not familiar with Opensuse, can you try downgrading to a previous version and see if issues reproduce?

Also if I’m reading timestamps and interpreting the release tags right from upstream (see my previous post) there may be an update from April 17th that hasn’t “released” yet to distros.

I downloaded the firmware updates into /lib/firmware/mediatek and rebooted. I’d love to say it solved the problem, but alas, it didn’t:

[    3.579145] mt7921e 0000:01:00.0: ASIC revision: 79220010
[    3.660815] mt7921e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20240409163301a
[    3.675854] mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20240409163347
[  104.681217] mt7921e 0000:01:00.0: Message 00020007 (seq 2) timeout
[  104.682029] mt7921e 0000:01:00.0: PM: dpm_run_callback(): pci_pm_restore+0x0/0xe0 returns -110
[  104.682056] mt7921e 0000:01:00.0: PM: failed to restore async: error -110
[  104.762009] mt7921e 0000:01:00.0: Failed to get patch semaphore
[  107.881192] mt7921e 0000:01:00.0: Message 00000010 (seq 15) timeout
[  107.881207] mt7921e 0000:01:00.0: Failed to get patch semaphore
[  111.080907] mt7921e 0000:01:00.0: Message 000046ed (seq 1) timeout
[  114.280656] mt7921e 0000:01:00.0: Message 00000010 (seq 2) timeout

New error, though:

[  556.214025] mt7921e 0000:01:00.0: loading /lib/firmware/mediatek/WIFI_RAM_CODE_MT7922_1.bin failed with error -4
[  556.214035] mt7921e 0000:01:00.0: Direct firmware load for mediatek/WIFI_RAM_CODE_MT7922_1.bin failed with error -4

Have the same problem on nix since weeks now.
Same build time 20240219103337

Opensuse is a rolling release distro and this has happened since I got my laptop in February… I have a bash code on my desktop that runs modprobe on the kernel module but its still somewhat annoying.

I don’t recognize any of these issues from my Ubuntu 24.04 AMD 13". Maybe it’s allergic to some WiFi configurations ? I generally have a strong signal - my Pixel phone reports never dropping lower than 50% as I move around the house.

AFAIK I have a default setup on the Frame.Work

$ iwconfig 
wlp1s0    IEEE 802.11  ESSID:"TP-LINK_BFBA_5G"  
          Mode:Managed  Frequency:5.18 GHz  Access Point: 98:DA:C4:C4:BF:BB   
          Bit Rate=702 Mb/s   Tx-Power=3 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=56/70  Signal level=-54 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:6   Missed beacon:0
$ sudo dmesg | grep mt7921e
[    3.016480] mt7921e 0000:01:00.0: ASIC revision: 79220010
[    3.094651] mt7921e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20240219103244a
[    3.110966] mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20240219103337
[    4.238507] mt7921e 0000:01:00.0 wlp1s0: renamed from wlan0

Just to be sure this isn’t with your current wifi network, try out personal hotspot and other Wifi networks as well.

Same behavior at home and at my shop, where my 11gen CoolerMaster works fine. Same router in both places though: ASUS RT-AC86U.

I decided I’ll use Ubuntu for debugging (wifi mostly works properly, except for after hibernating, but hibernating under Ubuntu is flaky anyway, at the moment.) In general, I’d rather get it working under Manjaro, which I prefer for everyday use.

Well, I’m not on Framework, but had MT issue after suspend/resume.
I was able to solve it be unloading/reloading the driver…

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

Giving it a try. Thanks for the suggestion.

Thanks! This is by far the cleanest option I have found so far.

Thanks. But not working for me. I just upgrade to kernel 6.8.8-2, but same behavior with wi-fi. My temporary fix is that I’ve reverted to suspend instead of hibernate. It’s not as efficient, but I don’t have to hassle with the wi-fi, either.

On a positive note, this issue doesn’t impact my opinion of Framework at all–I’m thrilled with my 11th Gen CoolerMaster, and really like my AMD. The Mediatek is putzy with linux, but I’ve been using Linux for decades, and the whole “everything works out of the box” concept is still kind of novel, so I’m rarely surprised when it doesn’t.

Well the proposed fix is for sleep/resume. The driver reload might work with hibernate as well, though that would need a bit different script to be placed in /usr/lib/systemd/systemd-hibernate-resume

In Arch (and therefore Manjaro), /usr/lib/systemd/systemd-hibernate-resume already exists as an executable owned by systemd.

Bit of an update.

I’ve tested against the Nov 2023 and Mar 2024 MediaTek 7922 firmware releases and the behavior is the same as the current release.

I’ve pinned this down to just Manjaro (and possibly OpenSUSE), and only after kernel 6.5. I’ve confirmed the mediatek wifi works properly on Manjaro 6.1, and on every other linux distro I’ve tried.

At this point, I figure it’s something introduced into the Manjaro kernels as of 6.6, and still fails up to 6.10. Just reported it on the Manjaro Forum, so we’ll see if anything turns up.

Hey,

this doesn’t look like a Manjaro issue, but indeed rather a kernel ( or kernel module) problem, because I also have this issue running NixOS. Currently with kernel 6.9.6 it’s broken, on 6.1 everything was fine.

I opened an issue at the openwrt/mt76 repo if anyone wants to +1 this:

My FW buildtime is 20240409163301a.

1 Like

Tha

That’s sort of a relief, so thank you. I finally jumped from 6.1 to 6.10 and am just putting up with the problem. Suspending, rather than hibernating, etc. Not that convenient, but tolerable.