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=1796382234; b=wx/Cgq6ZjMHJrOBVVATG/l6DdRV6f9GFGGEIG3m/r/5DFnaEZJYpoNC++nNxmPJwK+27 mDl1mxsfgHpL2343kFgvbLWET2NwM+0jqi/7H7SBd1OXDip1748v2u7KwkZ8pN2uFqcP2 XaIKcd0hSqZJMc9RKZwKaLhTlmS2vV/q7ry36aKDhckh6YAwPooV18qU+zz1xkanCV8Yw vIwq2bsS8xD9DYYf38Wo5kPdM8Ntn575030rovuqOru9QXgVC9WisZSk+eCk54uYx6EWJ sJ3vI3n0wC0c/wY915Mxsp5flT70V3chC0edlCY+nPrpkIv3+nG2PmJ5FmXfG6h/bMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382234; 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=aOoYQt0UTWcMl3BBxmC4ZPEON0lZTbTvzXfZqixXF3A=; b=P73dSXdHlmFQW1AgsUspzbaxEGGo2p9O4wRXPI+oHMdBxfIOardr5n9zp3btZ9Jnw081 TQU60LlLolCoceo7ieiwe9390t2eFeP/yLa39yEOfgMs5Hj+IzkL6DW3O45j8yuej0EJT FKVxQyy7d1NKF1OB4kTPvpQlf3yN0stBnorIXyAMM3SnU6hqgPJFSRxWzufHK9rZU8E+r 63fP18xM5plYoEpRvJcqyQI+rXif23b3O41Xl0x3LDFrWx4iXxeZB0l/p7yW+gSYMxix/ ocZBnkN69WYlwe9R2YFPbZ1o6ArNOZRKDC/7rdy4F6U7R6a77oP4thOXnjetLc+q/Ew== 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=Jlg0TJHR; 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 A5CBD606A322; Fri, 4 Dec 2026 11:03:54 +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=Jlg0TJHR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 241721F00897; Fri, 4 Dec 2026 11:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382234; bh=aOoYQt0UTWcMl3BBxmC4ZPEON0lZTbTvzXfZqixXF3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Jlg0TJHRxP/pcljPdo0S3morFvNSk+39eU4qB5odruKL31JNAGMPdR9zX3UJlV1a0 oetvUOSbOWBBd/+7RxERpgsGkLxJU7oPc5v/tlwNVPigt9BCkvTmOsWi674uDuUVOQ 5dBrSX0nFCzoliorNeuz8LRyJJmGU02HH6z5tgXU= 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.18 325/703] tg3: Skip management FW version when APE firmware is not ready Date: Fri, 4 Dec 2026 19:03:44 +0900 Message-ID: <20261204100636.432746815@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-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 662d16bdb5c33..2075d9eb8f367 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -16010,20 +16010,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) @@ -16102,8 +16108,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