Re: [PATCHv2 wireless] wifi: mt76: fix MAC address for non OF pcie cards

From: Felix Fietkau

Date: Wed Jul 22 2026 - 02:51:35 EST


Hi,

On 21.07.26 22:22, Klara Modin wrote:
On 2026-07-06 16:28:57 -0700, Rosen Penev wrote:
If seems the check for err is wrong as the proper macaddr gets written
to from the EEPROM itself. Meaning checking err from of_get_mac_address is
wrong as the proper macaddr has been written by this point.

Reported-by: Klara Modin <klarasmodin@xxxxxxxxx>
Closes: https://lore.kernel.org/all/ajRmlyx_AEGybykL@xxxxxxxxxxxxxxxx/
Reported-by: Tobias Klausmann <klausman@xxxxxxxxxxxxxxx>
Closes:
https://lore.kernel.org/linux-wireless/30a90714-02d8-45f2-a7f1-4cfe0627d50b@skade.local/
Fixes: 31ee1582717e ("wifi: mt76: fix of_get_mac_address error handling")
Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
Tested-by: Tobias Klausmann <klausman@xxxxxxxxxxxxxxx>
Tested-by: Klara Modin <klarasmodin@xxxxxxxxx>
---
v2: add extra tags and target wireless
drivers/net/wireless/mediatek/mt76/eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
index b99d7452800f..afdb73661866 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 (err) {
+ if (!is_valid_ether_addr(phy->macaddr)) {
eth_random_addr(phy->macaddr);
dev_info(dev->dev,
"Invalid MAC address, using random address %pM\n",
--
2.55.0


Ping. No one seems to have picked this up yet, but I suppose it is
holiday season.
It's in the mt76-fixes pull request that I just sent.

- Felix