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=1796380609; b=WyVvZKw49d7alD1H7sZ6OnKNFv7OpG81mPNlw6WvTLIK7QPUCsUGrXS2lt+7aoR2xBcL uo5lIegSK6xahJFqgyv6wWSOiJlvdKo0gCpXNsVlenIofEvPBtflHvOS2vHli0Ymo/zO7 vsgaFVcjf0oEMsP85ZJProShOt7ffz/7zRY2OaFBoDgnj9Xjwf1YMz9MrC3I6dqcNNvPY wyAGqFG6+jvneZUuC5+K221pWf9c2ig/8uXPzYpaUPkXo4t8auLZmlKefFLmjbLDvvrue HHco2x6SJhQT3kw/pttlFEf3AOhUeJ9rBpslKEZvmdl4JGIsy10Tv0oIe32sjJX6XIg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380609; 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=SFTAIg/TCDRkUDfT5dgI8ACsn3HtN+X5Hers2dxvN2Q=; b=TSj5v/8N19fXBt1N6UzQouz2iupbnh84DBMC1UOQQojuEhKPVzzNqyCHBz6HtjuajHbk Yytk7+96Vev4yNE4V68gLyB5X6NMDfZ3BjuOr1aNchJee7Li5kpD+hS5dYYPBqqCkMugm 2ZM2zn7IKaNWiVy3TNzOK4S2E05sB9X4k3JlpMfmk1yRlduJm/csSgyUTb/MeUhqvVIxd GpuRSGSvnqZk5kEkzakwx0MH3HWtPU9LgBO0DxKp12gP1SAYpF/1jowFXZ4fcS6FQBMUc jhEvdwMYLCivKklpsRwvfz6mTfKydctZ9I3cBdg2o42aV6oNMJNFIK0fty+xDi3LCcQ== 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=vjoj7ebi; 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 5C465606A682; Fri, 4 Dec 2026 10:36:49 +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=vjoj7ebi Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDE7A1F000C2; Fri, 4 Dec 2026 10:36:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380609; bh=SFTAIg/TCDRkUDfT5dgI8ACsn3HtN+X5Hers2dxvN2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vjoj7ebi74afHaH3uF59mTibwzGUvs1w+i1nia27Lp+r7vygb1myPkoxZlGbX0Qkk tdBT/LXOSKxB7M3AVcrOWPoqvubeTQlkY7DP3I2Uf1mSG03dePbKQ4tF8egEBX2E8O GNKoPjcgWIJtnGk18/K71agxDb7OBboq9ZGXEG9s= 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 7.3 311/742] tg3: Skip management FW version when APE firmware is not ready Date: Fri, 4 Dec 2026 19:02:55 +0900 Message-ID: <20261204100643.291195352@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 25a74ac8b80f1..4bd64124bdd9f 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.53.0