From: Pavan Chebbi <pavan.chebbi@broadcom.com>
To: michael.chan@broadcom.com, kuba@kernel.org
Cc: andrew+netdev@lunn.ch, andrew.gospodarek@broadcom.com,
davem@davemloft.net, edumazet@kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, Pavan Chebbi <pavan.chebbi@broadcom.com>
Subject: [PATCH net v3 2/3] tg3: Skip management FW version when APE firmware is not ready
Date: Wed, 18 Nov 2026 16:24:07 +0530 [thread overview]
Message-ID: <20261118105408.1076095-3-pavan.chebbi@broadcom.com> (raw)
In-Reply-To: <20261118105408.1076095-1-pavan.chebbi@broadcom.com>
When the APE firmware is not present or not ready, for example when
the NCSI component is missing in the NVRAM, tg3_read_fw_ver() still
calls tg3_read_dash_ver() after tg3_probe_ncsi(). The signature and
ready checks that tg3_read_dash_ver() used to make were moved into
tg3_probe_ncsi(), which only sets the NCSI flag and does not stop the
caller. The driver then reads the APE firmware version register, which
holds no valid data in this state, and ethtool -i shows an invalid
"DASH" string with a garbage version.
Make tg3_probe_ncsi() return whether valid, ready APE firmware was
found, and read the version only in that case. Otherwise just report
the bootcode version.
This was seen by a user on BCM5719/BCM5720 with no NCSI component in
the NVRAM. With this change, ethtool -i displays only the bootcode
version.
Fixes: 165f4d1cb3d7 ("tg3: Fix the setting of the APE_HAS_NCSI flag")
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 2cf9d2ea069b..5a0e247a4c46 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -15997,20 +15997,26 @@ static void tg3_read_mgmtfw_ver(struct tg3 *tp)
}
}
-static void tg3_probe_ncsi(struct tg3 *tp)
+/* Returns true if valid, ready APE firmware is present, regardless of
+ * whether it advertises NCSI (it may be DASH or SMASH). Sets APE_HAS_NCSI
+ * if the NCSI feature is advertised.
+ */
+static bool tg3_probe_ncsi(struct tg3 *tp)
{
u32 apedata;
apedata = tg3_ape_read32(tp, TG3_APE_SEG_SIG);
if (apedata != APE_SEG_SIG_MAGIC)
- return;
+ return false;
apedata = tg3_ape_read32(tp, TG3_APE_FW_STATUS);
if (!(apedata & APE_FW_STATUS_READY))
- return;
+ return false;
if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI)
tg3_flag_set(tp, APE_HAS_NCSI);
+
+ return true;
}
static void tg3_read_dash_ver(struct tg3 *tp)
@@ -16089,8 +16095,7 @@ static void tg3_read_fw_ver(struct tg3 *tp)
if (tg3_flag(tp, ENABLE_ASF)) {
if (tg3_flag(tp, ENABLE_APE)) {
- tg3_probe_ncsi(tp);
- if (!vpd_vers)
+ if (tg3_probe_ncsi(tp) && !vpd_vers)
tg3_read_dash_ver(tp);
} else if (!vpd_vers) {
tg3_read_mgmtfw_ver(tp);
--
2.52.0
next prev parent reply other threads:[~2026-11-18 10:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 10:54 [PATCH net v3 0/3] tg3: Bug fixes Pavan Chebbi
2026-11-18 10:52 ` netdev-bot+sinfo
2026-11-18 10:54 ` [PATCH net v3 1/3] tg3: Don't fail probe if 31-bit coherent DMA mask is unsupported Pavan Chebbi
2026-11-18 10:54 ` Pavan Chebbi [this message]
2026-11-18 10:54 ` [PATCH net v3 3/3] tg3: Fix heap overflow in unbuffered NVRAM write path 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=20261118105408.1076095-3-pavan.chebbi@broadcom.com \
--to=pavan.chebbi@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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