๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27550

Re: [PATCH net-next v2 2/4] net: phy: broadcom: Implement cable test initialization for BCM54210E

#27550
From: netdev-bot+sashiko
Date: Sun, 06 Dec 2026 00:07
72 lines
10365 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] In _bcm_phy_load_values() (drivers/net/phy/bcm-phy-lib.c), two
  comments say values are being restored, but the code only writes zeros.

--

net: phy: broadcom: Implement cable test initialization for BCM54210E

This commit loads vendor ECD parameters on the BCM54210E before a cable
test starts. It adds _bcm_phy_load_values() and
__bcm_phy_cable_test_init() to write the staging and paged expansion
registers. Only the BCM54210E model in _bcm_phy_cable_test_start() runs
this sequence.

> diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c
> index 4911dc8210cdd..1a170faf05aef 100644
> --- a/drivers/net/phy/bcm-phy-lib.c
> +++ b/drivers/net/phy/bcm-phy-lib.c
> @@ -657,6 +657,156 @@ static int __bcm_phy_enable_legacy_access(struct phy_device *phydev)

[ ... ]

> +/* Load the ECD page and clear the staging registers afterwards.
> + * The enable mask requires regs[] to list consecutive offsets from 0xe0.
> + */
> +static int _bcm_phy_load_values(struct phy_device *phydev,
> +				const struct __bcm_phy_regs *regs,
> +				size_t num_regs,
> +				u16 page_num)
> +{

[ ... ]

> +	/* Write strobe 0 */
> +	ret = __bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_SEL_ER + 0xcd, 0);
> +	if (ret < 0)
> +		return ret;
> +
> +	/* Restore expansion E* register values */
> +	for (i = 0; i < num_regs; i++) {
> +		ret = __bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_SEL_ER +
> +					  regs[i].reg, 0);
> +		if (ret < 0)
> +			return ret;
> +	}
> +
> +	/* And restore 0xEF register */
> +	return __bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_SEL_ER + 0xef, 0);
> +}

[Severity: Low]
This isn't a bug, but should these two comments say "clear" instead of
"restore"?

Nothing in _bcm_phy_load_values() reads or saves the earlier contents
of the E* staging registers or of MII_BCM54XX_EXP_SEL_ER + 0xef. Both
blocks just write 0 to them.

The header comment above the function says "clear the staging registers
afterwards", which matches what the code does. The two comments in the
body say the old values are restored, which contradicts the header.

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204233633.3790143-1-florian.fainelli%40broadcom.com
Technical Details
Message-ID: <179651565415.3148.2665665190321774221@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-nl.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378184-linux-kernel-netdev=dewy.ru
References: <20261204233633.3790143-3-florian.fainelli@broadcom.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-nl.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378184-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 2/4] net: phy: broadcom: Implement cable test
 initialization for BCM54210E
Date: Sun, 06 Dec 2026 00:07:34 +0000
Organization: Usenet Network
Message-ID: <179651565415.3148.2665665190321774221@kernel.org>
References: <20261204233633.3790143-3-florian.fainelli@broadcom.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3148096"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Xd2gqY+VbPGyM/5d6lu8zvbIoTM= sha256:Cw8/HY8unMHmKbNwZEd0lX4grIwT/iZyQ6svuriA+LU=
	sha1:3amGMHTCxlNooK3sjp+v1Pm6zec= sha256:0oy16oDv0iLXw38QCpV6OwbgOG7NzUgKZxD9zd6LNec=
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 C88F6117EFB; Sun,  6 Dec 2026 03:07:57 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.54
X-Spam-Status: No, score=-3.54 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, 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 omhxIjIioOOy;
	Sun,  6 Dec 2026 03:07:51 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378184-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 ACAAE117EF9; Sun,  6 Dec 2026 03:07:41 +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 983B0335D1; Sun,  6 Dec 2026 00:07:36 +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=1796515656;
	b=WoQJkyXJmBgSWR9CoOyLFvbsSM4Bcm8WuCn61UCEajbfdegPBQ1kukjUopeNkYzw29JP
	 DRsGONVaTkR+Ci51Ze3b0nIAXyLtpwQJ1ynexWKXT04Gsx9Cr6qhDmrhvu0AQGUMboJPy
	 7yJmD6moDQ+9yDMUjYOauMK8Zxb21Qv0axMk2Vt4zeBepOAqOnUE07NDSGUAJ954B6H1M
	 vV/a2aCDFD8EsJLN4G6DQVWyzGZXj77bEeLALZ8uwDxVnbq1E1MBLVzFTzO/hBo9vqVAI
	 sJ417Xw/Kcq4jm8dI/PiDCPPyqTYO6UYLDAlpkD7O5Do7lYpa5z6kni/+cWdhWwXMcQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796515656;
	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=ctnZJq7zOcqMxTarNru/Lo+MX2DLlIhL1P/9yKQ8K7I=;
	b=Vfr6oMuFUr2UOvRWKBmTfOJ01cNCBPFjnkV4CC9sm7k3fT+dujwrhlz4qRQUb/gYs8+Z
	 UMbAG3FTPyYx5x2IPyzfzmucJEjQ3jMjFjsRG6rPG7yHHW7NjmCQ8et4WXJEt1gMlSFgS
	 3YtUlM/sU6nG+p0CA1bvwWX2y8d28lulICg/2OFutlkvvPEwriN+4XCX/QaYwWresy0HY
	 pXALsXVeV0l5UUgnYKTY2fLvlkhbp+jGlYGofCtbW1mMOZK0JXTNvOR1wC7DV5yeZDbcy
	 Z0pe1B9CfyRc4PdeUO3wiQzA2Ga+sMZzzMlV7zYSBOXUX7yRrsDFE8gWhdC4nv4Gl0A==
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=YiMXoO6g;
	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 6E456606A333;
	Sun,  6 Dec 2026 00:07:36 +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=YiMXoO6g
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=1796515655;
	b=wZoyKLGIQ0Vcz3EIm++bI4fhttdkvGyYq569OPdTg8J+fEPkdhZrLPdiy5PbFD6p5pvA
	 7onhGQA8AuT9TgpaRRiKtfBEWXl9GYyRthsD0A4FA3QkqAyRS1VsGa0bOISGLh7cm+Yzl
	 2wOA4cMEzGoDQ5xlKfr1eshxusm/1DNf0EcJcFKeWA/40sscVzOTpMeoLnB7RvFmSqDNl
	 oZLtAFn6s7AN7M4t3pk6A4tGJdyPQAE/Mca3N3NNqTAFqGsHoifuX1SDvEaDFddNgS1JN
	 c02RowUHWxmtrm7o5M0QDYgE2rLewMomUC2kffKwoLw8CjsjJfRPu6DdtePmDrihq/Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796515655;
	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=ctnZJq7zOcqMxTarNru/Lo+MX2DLlIhL1P/9yKQ8K7I=;
	b=xVyK0209TVcmD6VKkylpJGSlvu5NKxnvfLaeqLCNIXBrKbxxMudtRqWUKo08lAAxmVcM
	 Sg4vdC+iSBdUpIiCF2o5sYjI6G8Fiaow/poLxssfgiMlAdPkN88Nli6YHfbFi1xKEZBP3
	 oF68z5dwdPLOgrS63eHTcBgAQ/+TSoYRtWPAwRJmMcU+7FB7COvzF/rQeg3EhbInDRnm9
	 V3ydakPo8qI8yQp0NFavxgMMXAAlt/QPmBi/CLV1hQQGeXoiwDskDqtAbDK5znMivaDLC
	 IHNZuQqh9R13/KaJXaPIr8OgjuGo7bO4nt9juMNzQR0lPyKWZ0R+Hg+6gTXinmZ/7fA==
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=YiMXoO6g;
	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 8E65B606A338
	for <netdev@vger.kernel.org>; Sun,  6 Dec 2026 00:07:35 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 931BC1F0092B;
	Sun,  6 Dec 2026 00:07:34 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796515655;
	bh=ctnZJq7zOcqMxTarNru/Lo+MX2DLlIhL1P/9yKQ8K7I=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=YiMXoO6g2OWc4MbKeEt3uC850DBcLuO4G3bJ7hWtFx+BccFRRoHL3GBckCNyuczvj
	 OxNn7V/RnS+lEjUc6hgjGVbgEBg8kCWL3EULqJtgHtrs0LTR/T6Xt7o+nWVpBlRhHY
	 sSC92qBdNCV5iTZZAiCnxYQ1PPiS+Wt8LtWclvmFXnFGrAAipEJ5q/jnSCC+KV+dI7
	 0GbfzaFKiW2mRPsQJpedjO/XIVVu2/s/5CLj/lFUM9kE+kEC7mVRHztPZWrvPlgdyo
	 t6bROLuAawOeb/v3c+pwS3cVzou1HvWzxibwYJr6+g3NWT4N7zuPWRprZHeMw4h3eS
	 X9ktNtiy/xTng==
X-Cc: netdev@vger.kernel.org, nb@tipi-net.de,
 bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, hkallweit1@gmail.com,
 linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com
X-In-Reply-To: <20261204233633.3790143-3-florian.fainelli@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