๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16655

Re: [PATCH net v2 3/4] tg3: Skip querying for management FW when no NCSI present

#16655
From: netdev-bot+sashiko
Date: Sun, 15 Nov 2026 12:58
75 lines
10640 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] tg3: missing APE FW readiness check in tg3_read_dash_ver() and
  wrong Fixes tag

--

> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -16045,19 +16045,21 @@ static void tg3_probe_ncsi(struct tg3 *tp)
>  
>  static void tg3_read_dash_ver(struct tg3 *tp)
>  {
> -	int vlen;
> -	u32 apedata;
>  	char *fwtype;
> -
> -	apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION);
> +	u32 apedata;
> +	int vlen;
>  
>  	if (tg3_flag(tp, APE_HAS_NCSI))
>  		fwtype = "NCSI";
>  	else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5725)
>  		fwtype = "SMASH";
> +	else if (tg3_asic_rev(tp) == ASIC_REV_5719 ||
> +		 tg3_asic_rev(tp) == ASIC_REV_5720)
> +		return;
>  	else
>  		fwtype = "DASH";
>  
> +	apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION);
>  	vlen = strlen(tp->fw_ver);
>  
>  	snprintf(&tp->fw_ver[vlen], TG3_VER_SIZE - vlen, " %s v%d.%d.%d.%d",

[Severity: Low]
tg3_read_fw_ver() calls tg3_read_dash_ver() unconditionally after
tg3_probe_ncsi(). That happens even when tg3_probe_ncsi() returned
early because TG3_APE_SEG_SIG did not match APE_SEG_SIG_MAGIC or
APE_FW_STATUS_READY was not set. Isn't the real problem "no APE
firmware is present or ready", rather than something specific to
5719/5720?

With this change only 5719/5720 are skipped. Other ENABLE_APE parts
such as 5717/5718, 5725, 5761, 5762 and 57764/57767/57787 may have no
management firmware. On those, tg3_read_dash_ver() will still read
TG3_APE_FW_VERSION out of uninitialized APE shared memory. It then
appends a bogus DASH or SMASH version to tp->fw_ver, and ethtool -i
reports that.

Before 165f4d1cb3d7 ("tg3: Fix the setting of the APE_HAS_NCSI
flag"), tg3_read_dash_ver() did the signature and ready checks
itself. tg3_ape_scratchpad_read() and tg3_ape_send_event() still do
them before touching APE shared memory.

Could tg3_probe_ncsi() instead report whether valid, ready APE
firmware was found? tg3_read_fw_ver() would then only call
tg3_read_dash_ver() in that case. Or is there a reason 5719/5720
need to be special cased even when the APE signature and ready bit
look valid?

Separately, ecc796486f0a ("tg3: Detect APE firmware types") still
had those guards in tg3_read_dash_ver(). So it does not look like
the commit that introduced this. Should the Fixes tag point at
165f4d1cb3d7 instead?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261111123917.910416-1-pavan.chebbi%40broadcom.com
Technical Details
Message-ID: <179474752307.2199510.11924630055532409529@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363704-linux-kernel-netdev=dewy.ru
References: <20261111123917.910416-4-pavan.chebbi@broadcom.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363704-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 3/4] tg3: Skip querying for management FW when no
 NCSI present
Date: Sun, 15 Nov 2026 12:58:43 +0000
Organization: Usenet Network
Message-ID: <179474752307.2199510.11924630055532409529@kernel.org>
References: <20261111123917.910416-4-pavan.chebbi@broadcom.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1803416"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:B+tANAS1Ea9AaWy9JC3B8siR/P8= sha256:sfsXF80EeJfp1RXeKpKrqzYxGhAyq8uiYM4YDlQIvmA=
	sha1:+1iQwUrpq08wpag8xSKnxxDueI8= sha256:HPdugguzplZt+O7qF1U9e0JdOjBrhX6uX3uGJMLWmao=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id E818F1149CF; Sun, 15 Nov 2026 15:59:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id baUpHu2wqd4J;
	Sun, 15 Nov 2026 15:58:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363704-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 886A211496A; Sun, 15 Nov 2026 15:58:51 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 835332E493; Sun, 15 Nov 2026 12:58:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794747525;
	b=1CkISgIeocjf1VPqS3BqSMuxiUbuAJnyqT4Efc9z8wLyz/s5tVopU5HrV+KEKOnYNXUC
	 4+g/a4CSakg2jklhiJ+OnFBap+sB98ngElwwmIEGnTYldtgc3gqn/toJYDU4FFxGc+7Nt
	 cp59YuPQ7Q3kVjpXBmFhe9ORvp+m+Kn3lAeCTg1sGf9+eyibk+A1Hod2tEawBTAYuY9no
	 BaH2DfRkXwyMBaH+nCoG+68yjsDWANT8VoTOx++MEvzDd/z5QerNheeNML1KFIjT+GES6
	 7FTOjwqRX8yuQf5ZxiXXFLxlqlIDQ94NzM7G9/7fHkAAsIIZbER2FlXdyHKpZd79MDg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794747525;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=gWntrJtlP68DocKhRKZpl0hzk7XL5osbaLsoTBjJDPc=;
	b=K4gL6bMnMUZ4ITn0GSNv+kZykPtkVWXuRCDOj3BksfmVphMxdu55d+v8+7fklcI7SiK1
	 ma3XA8wKRrEbtl43LLv7UGjLIRqikJZmHgeZoSuvWMksNR8bOKnhhRsGd9jDX82EZYOBF
	 JYJRTTskgBy9jF3gKtd6ArFw7lwlKMO4+J0FqbRNTaSJjE0P8ZUTLkv2iDvgxA9FzAH+v
	 legXpbXCXA4WBVx3GSoG/Q17JAuzIfKAuobuQXZu5ABmRvNrJW0HJMCKRYN4w1asI20JF
	 wqBl7o9x2rAP4L6Z0IQQdQuE75siPNYgmCRzVVcy33/Iy+eeWtVSxOkH0WsL+e2y80g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YRCFYG7i;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 2BA04606A31A;
	Sun, 15 Nov 2026 12:58:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YRCFYG7i
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794747524;
	b=5Qdkl3pH5/OLU4d/EeVtmtQGPKpMdJhupNebkWK9BIGOdBhmfF/SWWqizdzCj1wzAVQy
	 v2GD6PF5KZ/bDZV3dEbupyjugVb1lyQQkQQFvRt0JzXejGvgzJL/eaXV4PLQDAQoqMqqF
	 vzSwnpvki+DncyFquXcSqwagCaw7Pp3OCmUcqeAuTYAM3+aSv9QRdutqWnOlU7Ws6cAAY
	 dGSPdlOhD3Q5Q85T3VeSa5WI8jv43e/yjRHAki0DONiUgdTZ5uWhO7MAb3P+Mr6fFiNYy
	 HNb7+ExaiC7yeRCg5hekP6tXpy4FpTDQEwxIytkhTckjgeMHLcmFPDrJbDgBxFuqAmQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794747524;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=gWntrJtlP68DocKhRKZpl0hzk7XL5osbaLsoTBjJDPc=;
	b=tR17QPIzhG5CP3OAeYClMh2/DGt1RdhJ1USzWvP3pECOb9aQsOIeBQngLp6E1mHw5Sa+
	 pUciyJgZb5n3Xq/ddaxK87USpHjAh470CIAGJDSpefHuvZsREAkAw4qt8uJqY2W5gUHuf
	 laaa4CCEPFmQ1886YESMgi+piLLRDBLlBcy9XLKdMjaaJVofsgsKRbhM6WQd1d6cUNCml
	 czE99dIN1X1h+5IFHfFpMXbPOK0PHjUFG0ZxO3lKFdqOyuPYkqQsBd30XwQbQPzFzzXh6
	 +MPif/qxBBbmvHn8dxOyZPIx2pJW8V+KlzlVuiln97Gn89ZWYAhDz8nmCBFRKRQqANw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YRCFYG7i;
	arc=none smtp.remote-ip=100.103.45.18
X-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 4DEEC606A329
	for <netdev@vger.kernel.org>; Sun, 15 Nov 2026 12:58:44 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8741F1F000C4;
	Sun, 15 Nov 2026 12:58:43 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794747524;
	bh=gWntrJtlP68DocKhRKZpl0hzk7XL5osbaLsoTBjJDPc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=YRCFYG7iXAWnqjo1nkvj8t51Z+xeh+4G10vvh6trnzoNsQT5f6nOufJ9WtrskZVeh
	 6DHha/8n5LOEjhLupnOg4dWkUzKaz6W22Lend8Vy+zhVJYM7aEAs2YyPiDpb9Ll/W4
	 nvxAPie5mYGhyJEX7TVgjNUIISL5vIKWQKdU01kn0QGl0hgM+Yuhc6dpGMiUx2lo7o
	 1uunXzMsjzANRG/98SWVVjU9YgKAU0teD8+VQzNJ5QPHI2G3hCCzRcuPxgr15mZe6N
	 eUkqmn4FtrciBvVk75U1lC25ydq+1iqRvQAci5itc/SFuOZetQLf6y0F7KGbkXFkqZ
	 P7tiejfqamxmw==
X-Cc: michael.chan@broadcom.com, kuba@kernel.org, andrew+netdev@lunn.ch,
 andrew.gospodarek@broadcom.com, davem@davemloft.net, edumazet@kernel.org,
 netdev@vger.kernel.org, pabeni@redhat.com, shravya.k-n@broadcom.com,
 vishvambar.panth-s@broadcom.com
X-In-Reply-To: <20261111123917.910416-4-pavan.chebbi@broadcom.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list