Netdev List
 help / color / mirror / Atom feed
From: Ivan Delalande <colona@arista.com>
To: Jakub Kicinski <kuba@kernel.org>,
	Michael Chan <michael.chan@broadcom.com>,
	Pavan Chebbi <pavan.chebbi@broadcom.com>
Cc: netdev@vger.kernel.org, Paul SAGE <paul.sage@42.fr>,
	Vincent MORVAN <vinc@42.fr>,
	Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
Subject: [PATCH net] tg3: check NVRAM and control register if SRAM has the placeholder MAC address
Date: Thu, 3 Sep 2026 16:32:55 -0700	[thread overview]
Message-ID: <20260903233255.GA4109366@visor> (raw)

Some of the tg3 NICs we use (BCM57762) reset the SRAM MAC address to the
placeholder address on link flaps, tg3_chip_reset, etc. We've typically
fixed it from userspace, but since e4c00ba7274b ("tg3: replace
placeholder MAC address with device property") was merged, tg3 just
fails probe as we don't have a way to get it through the generic
device_get_mac_address infrastructure on our systems.

Since that commit effectively made the placeholder address invalid,
include this check in the earlier `addr_ok` expression, so we proceed
with the NVRAM and control register fallback to find a valid MAC.

Fixes: e4c00ba7274b ("tg3: replace placeholder MAC address with device property")
Signed-off-by: Ivan Delalande <colona@arista.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 73a4b569b03e..0b47908f0935 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -17081,7 +17081,8 @@ static int tg3_get_device_address(struct tg3 *tp, u8 *addr)
 		addr[5] = (lo >>  0) & 0xff;
 
 		/* Some old bootcode may report a 0 MAC address in SRAM */
-		addr_ok = is_valid_ether_addr(addr);
+		addr_ok = is_valid_ether_addr(addr) &&
+			  !tg3_is_default_mac_address(addr);
 	}
 	if (!addr_ok) {
 		__be32 be_hi, be_lo;
-- 
2.43.0

             reply	other threads:[~2026-09-03 23:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 23:32 Ivan Delalande [this message]
2026-09-09  2:33 ` [PATCH net] tg3: check NVRAM and control register if SRAM has the placeholder MAC address netdev-bot+sashiko
2026-09-10  2:17 ` Jakub Kicinski
2026-09-10  5:31   ` Ivan Delalande
2026-09-10  6:02     ` Pavan Chebbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260903233255.GA4109366@visor \
    --to=colona@arista.com \
    --cc=atharvatiwarilinuxdev@gmail.com \
    --cc=kuba@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.sage@42.fr \
    --cc=pavan.chebbi@broadcom.com \
    --cc=vinc@42.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox