Force custom firmware for a mt7915e card (AW7915-NPD)

I have been running into some problems getting a stable performance from my AsiaRF AW7915-NPD card, ever since kernel version 5.15 (which was the last working version for me).

That being said, this isn't a problem, specific to OpenWrt, but to any distro using kernel past 5.15.

I lack the skills and knowledge (and perhaps the tools) to diagnose what exactly is causing this but you can see my other thread (which at this point is a few years old).

I have tried downloading different eeprom but I have my doubts that anything in /lib/firmware/mediatek/ is actually used by the driver, or maybe the driver is using some other EEPROM, or maybe there is a race condition somewhere during the initialization because sometimes, like 1 out of 15 reboots, the card works, but when it works, it is actually very stable.

The rest of the reboots, I get random crashes, freezes, kernel panics within a minute or two after booting up to OpenWrt, sometimes it does not crash but the card still fails to work - all this happens more than 90% of the time.

I am still unsure what is causing this but as a part of my wider investigation, I have been somewhat fixated that it must be the driver not loading the correct eeprom because I have compared:

/sys/kernel/debug/ieee80211/phy0/mt76/eeprom

with

/lib/firmware/mediatek/mt7915_eeprom.bin

and they appear to be different. They differ even when the card boots properly.

I suspect there might be an eeprom on the card itself which the driver reads, meaning that any custom firmware in /lib/firmware/mediatek/ gets skipped.

My question is: should there be any difference in the eeproms, i.e. how does the mt76 driver work with mt7915e and most importantly, how do I guarantee that the correct eeprom gets loaded?

Rename file so it can not load to check?

Which file?

/sys/kernel/debug/ieee80211/phy0/mt76/eeprom
is showing the currently loaded and running firmware. If it is being taken from the card itself, I am not entirely certain where to look.

/lib/firmware/mediatek/mt7915_eeprom.bin
is the custom firmware, which comes with the kmod-mt7915-firmware package

If the running firmware is taken from /lib/firmware/mediatek/ , would it not be the same? The fact that it isn't makes me think it is being loaded from elsewhere.

Answer in ques%ion?

That comparison is not valid, /sys/kernel/debug/ieee80211/phy0/mt76/eeprom, is pointing to info in the running kernel. Its not a copy of a loaded file.

What platform are you using? I am running a similar card, AW7915-NP1, without problems in an 'Extreme Networks WS-AP3825i'.

2 Likes

I am using a x86-based platform.
If the comparison is not valid, what is the purpose of having downloaded the kmod-7915-firmware package? I am still struggling to understand how the firmware is being utilized and whether the card has onboard eeprom?

Why you keep throwing dirt and hope something sticks? Describe problem you are facing, with technical details.

Because I am not sure what exactly is causing it. I keep getting upon boot the following messages (they repeat until the whole system crashes)

[   35.798718] mt7915e 0000:04:00.0: Retry message 00001eed (seq 7)
[   56.224088] mt7915e 0000:04:00.0: Message 00001eed (seq 7) timeout

However every once in like 10-15 restarts, the wifi adapter actually gets properly initialized and works as intended without any hitch for days on end, until reboot. If I reboot it, I have to reboot it again like dozens of times before it starts functioning. As you can imagine, this issue cannot be consistently reproduced. I have tried different firmware, does not work.

I just don't know where to look. I found the following thread on github which describes the issue:

and it is said there the problem should have been more or less fixed in 24.10.1, however I am still getting the same old error even with 24.10.1.

The latest message there suggests there might be a need to apply 3 patches:
"The only thing missing is this patch or rather the series of 3 patches
https://patchwork.kernel.org/project/linux-wireless/patch/20250402004528.1036715-3-mail@david-bauer.net/"
However, I am unsure what I need to do because it is way outside the scope of what I have previously done.

As described there (and in the beginning of this thread), the problem began after kernel 5.15, and it is not OpenWrt-specific. It is a regression in the kernel.

1 Like

I am now trying to add some patches to mt76/mt7915/mcu.c as outlined here:

I have ran:

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git checkout v24.10.1

then checked the version for mt76 in makefile, then ran

git clone https://github.com/openwrt/mt76.git ~/custom-mt76
cd ~/custom-mt76
git checkout e5fef138524e63314cb96ff8314048d175294e95

after that, I made the necessary changes in mt76/mt7915/mcu.c, then edited the mt76 makefile in ~/openwrt so it points to the local source instead of using the repo.

However, before I go ahead and compile the image, I am worried that it will make my custom installation unable to install official packages from the repo due to hash mismatch.
Am I correct and if so, how could I avoid this?