[PATCHv2 wireless] wifi: mt76: fix MAC address for non OF pcie cards
Felix Fietkau
nbd at nbd.name
Tue Jul 21 23:40:56 PDT 2026
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 at gmail.com>
>> Closes: https://lore.kernel.org/all/ajRmlyx_AEGybykL@soda.int.kasm.eu/
>> Reported-by: Tobias Klausmann <klausman at schwarzvogel.de>
>> 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 at gmail.com>
>> Tested-by: Tobias Klausmann <klausman at schwarzvogel.de>
>> Tested-by: Klara Modin <klarasmodin at gmail.com>
>> ---
>> 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
More information about the Linux-mediatek
mailing list