mt76 newly rejects formerly working MAC from EPROM

Tobias Klausmann klausman at schwarzvogel.de
Mon Jun 29 11:02:06 PDT 2026


Hi!

As of 7.2-rc1, my mediatek USB wifi dongle no longer works the way it
used to. I now get an error about its MAC being wrong:

usbcore: registered new interface driver mt7921u
mt7921u 8-1:1.0: HW/SW Version: 0x8a108a10, Build Time: 20260224110909a
mt7921u 8-1:1.0: WM Firmware Version: ____010000, Build Time: 20260224110949
mt7921u 8-1:1.0: Invalid MAC address, using random address c2:4d:ae:23:29:38
mt7921u 8-1:1.0 wlxc24dae232938: renamed from wlan0

This naturally breaks my udev rules, interface naming etc etc.

So I bisected it, and this is the commit that started it:

commit 31ee1582717e220cc5a3fa8f3940d5693c5c9169 (HEAD)
Author: Rosen Penev <rosenp at gmail.com>
Date:   Sun Apr 26 22:17:46 2026 -0700

    wifi: mt76: fix of_get_mac_address error handling
    
    Check return value instead of is_valid_ether_addr. The latter is handled
    by the former.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Acked-by: Lorenzo Bianconi <lorenzo at kernel.org>
    Link: https://patch.msgid.link/20260427051746.954704-1-rosenp@gmail.com
    Signed-off-by: Felix Fietkau <nbd at nbd.name>

diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
index afdb73661866e..b99d7452800fd 100644
--- a/drivers/net/wireless/mediatek/mt76/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
@@ -181,7 +181,7 @@ mt76_eeprom_override(struct mt76_phy *phy)
        if (err == -EPROBE_DEFER)
                return err;
 
-       if (!is_valid_ether_addr(phy->macaddr)) {
+       if (err) {
                eth_random_addr(phy->macaddr);
                dev_info(dev->dev,
                         "Invalid MAC address, using random address %pM\n",

SO I thought that maybe my device had had a broken MAC all this time,
and I just didn't notice. I changed the code a bit to emit the erroneous
MAC and the value of err, which resulted in:

usbcore: registered new interface driver mt7921u
mt7921u 8-1:1.0: HW/SW Version: 0x8a108a10, Build Time: 20260224110909a
mt7921u 8-1:1.0: WM Firmware Version: ____010000, Build Time: 20260224110949
mt7921u 8-1:1.0: Invalid MAC address e0:e1:a9:38:96:29 err: -19
mt7921u 8-1:1.0: Using random address 3a:ca:1d:51:83:f2
mt7921u 8-1:1.0 wlx3aca1d5183f2: renamed from wlan0

To me, e0:e1:a9:38:96:29 looks like a perfectly valid MAC, so at a
minimum, the current code's wording is misleading: it assumes the only
way of_get_mac_address() can ever return a nonzero value is if the MAC
is invalid. However, looking at its code, I only see one nonzero return
statement, which returns ENODEV, which seems at odds with "broken MAC".

Either way, I am looking for a way to get a stable MAC again, either by
fixing this commit (if it is indeed a bug) or fixing my hardware (if the
bug is there.

Best,
Tobias Klausmann



More information about the Linux-mediatek mailing list