Skip to contentSkip to conversation

wifi: mt76: fix MAC address for non OF pcie cards

PATCH Superseded Rosen Penev 5 participants 5 messages Jun 30 – Jul 8

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mt76: fix MAC address for non OF pcie cards

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.

Fixes 31ee1582717e ("wifi: mt76: fix of_get_mac_address error handling")
---
 drivers/net/wireless/mediatek/mt76/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/eeprom.c +1 -1
index b99d7452800f..afdb73661866 100644
@@ -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",
Signature · 1 line
2.55.0
#1 lore raw
Quoted 3 lines · Rosen Penev

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.

By our submission guidelines and requests from Linus this afaics should also contain:

Closes:
https://lore.kernel.org/linux-wireless/[email protected]/

Both of them now CCed, too, to give them a chance to provide a "Tested-by:".

Quoted 1 line
Fixes 31ee1582717e ("wifi: mt76: fix of_get_mac_address error handling")

Given this and the reports linked above this afaics should also be tagged with "wireless", and not with "wireless-next", as this commit is in 7.2-rc1 -- and thus ideally should be fixed by now. See
https://www.kernel.org/doc/html/latest/process/handling-regressions.html#on-how-quickly-regressions-should-be-fixed,
which contains links to these quotes from Linus:

""But a user complaining should basically result in an immediate fix - possibly a "revert and rethink"."" and ""It's also worth noting that "immediate" obviously doesn't mean "right this *second* when the problem has been reported". But if it's a regression with a known commit that caused it, I think the rule of thumb should generally be "within a week", preferably before the next rc.""

Ciao, Thorsten

Quoted 18 lines
---
 drivers/net/wireless/mediatek/mt76/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/eeprom.c +1 -1
index b99d7452800f..afdb73661866 100644
@@ -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 lore raw

Hi!

Quoted 8 lines · Thorsten Leemhuis
Quoted 3 lines · Rosen Penev

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.

By our submission guidelines and requests from Linus this afaics should also contain:

Quoted 9 lines

Closes:
https://lore.kernel.org/linux-wireless/[email protected]/

Both of them now CCed, too, to give them a chance to provide a "Tested-by:".

Quoted 1 line
Fixes 31ee1582717e ("wifi: mt76: fix of_get_mac_address error handling")

Indeed:

I've been running 7.2.0-rc1+the revert for a few days now with zero issues (not that I expected any).

Best,
Tobias

Tested-by on v1 1/1
#3 lore raw
In reply to Rosen Penev
Quoted 6 lines · Rosen Penev

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.

Fixes 31ee1582717e ("wifi: mt76: fix of_get_mac_address error handling")
Quoted 20 lines
---
 drivers/net/wireless/mediatek/mt76/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/eeprom.c +1 -1
index b99d7452800f..afdb73661866 100644
@@ -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",
Signature · 1 line
2.55.0
Tested-by on v1 1/1
#4 lore raw
In reply to Rosen Penev
Quoted 6 lines · Rosen Penev

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.

Fixes 31ee1582717e ("wifi: mt76: fix of_get_mac_address error handling")

Fixed, thanks.

Quoted 21 lines
---
 drivers/net/wireless/mediatek/mt76/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/eeprom.c +1 -1
index b99d7452800f..afdb73661866 100644
@@ -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",
Signature · 1 line
2.55.0