From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E4A43ACA41; Wed, 8 Apr 2026 18:28:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672928; cv=none; b=aqTo4+1B+Kv/Yulp9FNtuoe8IT+BY5CIHPOjW8xhh/0hm2+00bdkoAcjMkpzr/8wZNYIxFbsIjUTvmzbiuHuOdcCmVgV40l9fRA4kOzvqzHipHgDiD8jLEbc+hXyGZz3gJ8793V/HVzGpySsscdgW7Kz5o6n00qMPNo4kc4siAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672928; c=relaxed/simple; bh=IbkNNMMtvdsSu+jSOZ6AONTynWyThQ3grGeBrhjuAm8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VcbxAIDbJkkCE38hruXIGDa9RM9yGErAFzVvjcu33JEbY7GJ7aMNeaSuhK7BVd/CTHdlv08J393ki+YCbxBiwCnxMyq9CyPGypXR3DDrTrZo5XYFbNwdwTbQwlhbB9c6BNG4sPxX0vIzolE4Iv5ekoRWaz+OmH7bbqyysxyQ6hg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ljpRgDnt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ljpRgDnt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C70AEC19421; Wed, 8 Apr 2026 18:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775672928; bh=IbkNNMMtvdsSu+jSOZ6AONTynWyThQ3grGeBrhjuAm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ljpRgDntmF65TS06JOPnSJYv8PEbzL2k9b11nkKa7jQm7s/kylt7xKef/Tai4f7QP 1L9Cx/UVX+wWFsJYlI8N06aeCfKOPb7rUsStlZEhY94y4F4j4MdOFkZUKLsfy2cdKY Ok+m8K5YLJtOdF6oeHQ3wESW1rTLpGkgiZ+eNvKI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Rishon Jonathan R , Vincent MORVAN , Paul SAGE , Atharva Tiwari , Michael Chan , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 007/277] tg3: replace placeholder MAC address with device property Date: Wed, 8 Apr 2026 19:59:52 +0200 Message-ID: <20260408175934.118586411@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175933.836769063@linuxfoundation.org> References: <20260408175933.836769063@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul SAGE [ Upstream commit e4c00ba7274b613e3ab19e27eb009f0ec2e28379 ] On some systems (e.g. iMac 20,1 with BCM57766), the tg3 driver reads a default placeholder mac address (00:10:18:00:00:00) from the mailbox. The correct value on those systems are stored in the 'local-mac-address' property. This patch, detect the default value and tries to retrieve the correct address from the device_get_mac_address function instead. The patch has been tested on two different systems: - iMac 20,1 (BCM57766) model which use the local-mac-address property - iMac 13,2 (BCM57766) model which can use the mailbox, NVRAM or MAC control registers Tested-by: Rishon Jonathan R Co-developed-by: Vincent MORVAN Signed-off-by: Vincent MORVAN Signed-off-by: Paul SAGE Signed-off-by: Atharva Tiwari Reviewed-by: Michael Chan Link: https://patch.msgid.link/20260314215432.3589-1-atharvatiwarilinuxdev@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/tg3.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 0397a6ebf20f9..a04b5eb02689d 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -17042,6 +17042,13 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) return err; } +static int tg3_is_default_mac_address(u8 *addr) +{ + static const u8 default_mac_address[ETH_ALEN] = { 0x00, 0x10, 0x18, 0x00, 0x00, 0x00 }; + + return ether_addr_equal(default_mac_address, addr); +} + static int tg3_get_device_address(struct tg3 *tp, u8 *addr) { u32 hi, lo, mac_offset; @@ -17115,6 +17122,10 @@ static int tg3_get_device_address(struct tg3 *tp, u8 *addr) if (!is_valid_ether_addr(addr)) return -EINVAL; + + if (tg3_is_default_mac_address(addr)) + return device_get_mac_address(&tp->pdev->dev, addr); + return 0; } -- 2.53.0