From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383649; b=zO6TgHVtxIUiVl86wVZpcIGkcv71da8W+t77kLa6j+EmTaAOvQgGhZza3uL6yCW2TtVc y744K/RPC47lZ1b3P2940FUJC/9ZtPaiYADnkPe2KCaV+yQSJbFbmKWXvvtL+u5P/jEI2 hXixnj4OlXXDeTEoRPcip0vQIhXf/PbEB5zlPgnTDNwgExCjVdfvN6LGrfDiR6vHJ4xIa 9+7gzb6okOCEIfeBZpgUS63qXOd0TlMNtKoL9BdU96H/yGCtkk3V9e4jKoNp+gPmQ7Nhr qoj6zbwkp5+KV2BH6BBvKskNEczFcKCs8LMk0tu5RICLP1V3bdXCgpynpY5TUrvSgvQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383649; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=H6Ntxaw3VrERvmxnPNDtovz7iTcOw2xMdD0dZ7GzqlA=; b=lB5taLZJmlsH8uRDUGW1xcSn3kDcdrGGQM92zDBU126J1ZdQ+m+cRc/ru0RrkLoZq6VS gkRXEJYt0mc0JxUytd1GAyZhR+7cS1FD4ffhiHo78YI8DvpfXIQel+AHAilf+a7bpgA6w 2QabYUeJMRgmJ71TmQxgPMv+zqYFCHA3JeH34fsZXkxmvP+PTOjuzeG7Dx0UMYefsj2PH 63ooCFdX7Tf3pc2KFOO7BVzP/oymXQe3Dc+Wx4twViGjaUwZN9a6v2n/2h8b8hG8Ym73o CpeXBQiSXTRZ4dFYa2HWZYe9VhT7QRbbIAxaUWXKi4VohI31A3Dsvxi5Ay+5xsfLHbw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=aIplbtH6; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53334606A333; Fri, 4 Dec 2026 11:27:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=aIplbtH6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAF851F000CE; Fri, 4 Dec 2026 11:27:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383649; bh=H6Ntxaw3VrERvmxnPNDtovz7iTcOw2xMdD0dZ7GzqlA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aIplbtH6u4EA0aJrL34Kfgf9UxqvIhZ8M9Dd0gfPaMmmdaonDTU3l+kdOOgdAxCeI K15U1NU/TmbXb520qdtn20/Alx5L85pBDkCke51MEevc7TjUArpvQ5FVz3m+IXurZq fgHYiuNWimHh75RcUh//18h7XzWASBtdH+16cpes= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pavan Chebbi , Simon Horman , Paolo Abeni , Sasha Levin Subject: [PATCH 6.12 311/555] tg3: Skip management FW version when APE firmware is not ready Date: Fri, 4 Dec 2026 19:05:54 +0900 Message-ID: <20261204100621.312807082@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pavan Chebbi [ Upstream commit 70e57e1255e06fd7a22d45dd2bf854200fcbd575 ] 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 Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261118105408.1076095-3-pavan.chebbi@broadcom.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- 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 12fea72cbf105..a243c38a16f2e 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -15983,20 +15983,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) @@ -16075,8 +16081,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.53.0