🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21744

Re: [PATCH net-next v3 5/7] net: phy: adin1100: Skip the soft reset on ADIN1110/ADIN2111

#21744
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 12:02
142 lines
13300 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] The commit message claims the whole-chip reset done by
  CRSM_SFT_RST "is not an issue with the generic SPI protocol" because…
- [Low] The patch justifies dropping .soft_reset with "The MAC driver
  already resets the chip before attaching the PHY".

--

net: phy: adin1100: Skip the soft reset on ADIN1110/ADIN2111

This commit removes .soft_reset from the ADIN1110 and ADIN2111 entries
in the adin1100 PHY driver. On these chips CRSM_SFT_RST resets the whole
MAC-PHY, not only the PHY. The change prepares for OPEN Alliance TC6
support, which configures the device before the PHY is attached.

> This is not an issue with the generic SPI protocol, where the adin1110
> driver configures the MAC in ndo_open, after phy_connect(). The OPEN
> Alliance TC6 protocol support, added in a following patch, configures
> the device in oa_tc6_init() before the PHY is attached, and the
> configuration would be lost.

[Severity: Low]
Is this accurate for the existing generic SPI driver? After ndo_open,
phylib can still call phy_init_hw() -> drv->soft_reset on at least two
paths.

The first path is system resume. adin1110 has no PM callbacks and does
not set phydev->mac_managed_pm, and adin_suspend is set. With WoL off
this gives:

mdio_bus_phy_suspend()
  ...
mdio_bus_phy_resume()
  phy_init_hw()
    adin_soft_reset()

On ADIN2111 this happens once for each PHY.

The second path is an SIOCSMIIREG write of BMCR_RESET while the
interface is up:

adin1110_ioctl()          /* only when netif_running() */
  phy_do_ioctl()
    phy_mii_ioctl()
      phy_init_hw()
        adin_soft_reset()

On both paths the whole-chip reset would wipe the setup done in
adin1110_net_open():

	ret = adin1110_write_reg(priv, ADIN1110_CONFIG2, ADIN1110_CRC_APPEND);

It would also wipe the IMASK1 interrupt enables and the MAC
address/filter slots. The interface would stay broken until it is
reopened.

If that's right, this patch also fixes a runtime problem for current
generic SPI users. Could the commit message describe that, and add a
Fixes: tag so the change can be considered for stable? .soft_reset has
been set for these PHY IDs since the IDs were added.

> diff --git a/drivers/net/phy/adin1100.c b/drivers/net/phy/adin1100.c
> index a69c3228961e9..bc7214b735057 100644
> --- a/drivers/net/phy/adin1100.c
> +++ b/drivers/net/phy/adin1100.c
> @@ -341,7 +341,6 @@ static struct phy_driver adin_driver[] = {
>  		PHY_ID_MATCH_EXACT(PHY_ID_ADIN1110),
>  		.name			= "ADIN1110",
>  		.get_features		= adin_get_features,
> -		.soft_reset		= adin_soft_reset,
>  		.probe			= adin_probe,
>  		.config_aneg		= adin_config_aneg,
>  		.read_status		= adin_read_status,
> @@ -357,7 +356,6 @@ static struct phy_driver adin_driver[] = {
>  		PHY_ID_MATCH_EXACT(PHY_ID_ADIN2111),
>  		.name			= "ADIN2111",
>  		.get_features		= adin_get_features,
> -		.soft_reset		= adin_soft_reset,
>  		.probe			= adin_probe,
>  		.config_aneg		= adin_config_aneg,
>  		.read_status		= adin_read_status,

[Severity: Low]
The commit message says "The MAC driver already resets the chip before
attaching the PHY". On the generic SPI path, does anything wait for that
reset to finish?

adin1110_probe() checks only the return value of the SPI write, then
registers the MDIO bus and connects the PHYs:

drivers/net/ethernet/adi/adin1110.c:adin1110_probe() {
    ...
	ret = adin1110_write_reg(priv, ADIN1110_RESET, ADIN1110_SWRESET);
	if (ret < 0)
		return ret;

	ret = adin1110_register_mdiobus(priv, dev);
    ...
	return adin1110_probe_netdevs(priv);
}

There is no STATUS0 RESETC poll and no delay here. The 90 ms fsleep in
adin1110_check_spi() only runs with the optional reset GPIO, and it runs
before the SWRESET.

Before this patch, adin_soft_reset() polled ADIN_CRSM_STAT for
ADIN_CRSM_SYS_RDY, for up to 30 ms, before any PHY register write at
attach time. With .soft_reset now NULL, the attach path is:

adin1110_probe_netdevs()
  phy_connect()
    phy_attach_direct()
      phy_init_hw()
        adin_config_intr()   /* read IRQ status, RMW IRQ mask */
      phy_resume()
        adin_resume()        /* writes CRSM_SFT_PD_CNTRL */

The commit message itself says MDIO data is stale until the reset
completes. Could these writes race with the unconfirmed SWRESET and be
lost?

The impact today looks limited:

- phy_start() calls __phy_resume() again at ndo_open, so adin_resume()
  runs a second time.
- The adin1110 mii_bus leaves irq[] at PHY_POLL, so the IRQ mask write
  has no functional effect.
- Before this patch, the MDIO bus scan and the adin_get_features()
  reads already ran right after the SWRESET without any wait.

Still, any PHY configuration added at attach time for these IDs could be
silently lost. Should adin1110_probe() wait for the reset to complete
before calling adin1110_register_mdiobus()?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123115743.29523-1-iustin.stolniceanu%40analog.com
Technical Details
Message-ID: <179552176854.3135.14043257413847529020@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370299-linux-kernel-netdev=dewy.ru
References: <20261123115743.29523-6-iustin.stolniceanu@analog.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370299-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3 5/7] net: phy: adin1100: Skip the soft reset
 on ADIN1110/ADIN2111
Date: Tue, 24 Nov 2026 12:02:48 +0000
Organization: Usenet Network
Message-ID: <179552176854.3135.14043257413847529020@kernel.org>
References: <20261123115743.29523-6-iustin.stolniceanu@analog.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4129032"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:U2RR2ftzuBJX1Z97+3rWZSS3URI= sha256:g6SlqvGy+0XSZVDpi8RLEm0cDRvxfGwTtJ9TLaeubGM=
	sha1:fXGsNYTrS4d6a8Qh52eovem3Wzs= sha256:TJ1GYMAmsL0kYqOSg8Pb//aTIdphlt/ZmhS6bP6P6bI=
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 009A3125E02; Tue, 24 Nov 2026 15:03:41 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.301
X-Spam-Status: No, score=-2.301 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, 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 uz_8zSlwuKro;
	Tue, 24 Nov 2026 15:03:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370299-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 EAB36125DFF; Tue, 24 Nov 2026 15:03:28 +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 BDE493B283; Tue, 24 Nov 2026 12:02:56 +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=1795521776;
	b=znfIAEvp29x6DcSynBU89oN95vtgVP2p0xnRHqjb3dx8WvtjizkWS05rkrIv6zAVuYyH
	 e8QM03Ow8L0tU+JOK57JDvOA9zXbXr6L42OUhVLwbYS/nGVBxWtpwXAZqlpQuM9vzDQKM
	 tU5agTtgMiMPtJ82x3+qGOJaTciXvRcgfjxWuulLjuSNzpLjY/YU/q+Wi5DGK5TQI/EK2
	 UzRzbOYyPgKayCtu7k8WZWYE4x/NJHk/X7uGbTYJSvYOJ8UkasYCJzxyFFcrCXauZUy4K
	 pejGcpAs4j+feuJGo1YNblZlJL8aAwXQ3iMC+Gy+24DFegLOKgSQAavpvuLz5vAxBPg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795521776;
	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=J/hgjS5wptIfTKZPK4+3uy6djn7gSRXd68ZCyUQWT1s=;
	b=ufCjexegFw5SFFLlsMKqUpIR57eZhBzmndRHrcl8y5Nkc2SLvaANgaDtUO79OstNSr85
	 rjBPYrNNTqQokltE1h+DIg/UjfarTex+WgFFihPUfoebF7N9owNA0bG+YeF1G8oY7HUc4
	 NVOfZhCeJ775slFaCeTHKu88gs42VTS9D6Gj3VqKUgCBg8Me3F4zYrardkjiE6CGAfvzC
	 eg/bKiLIsqgq72s94TFXhuHSXHIxr1r48XRjatYmboX6CIaKjB5jOfNslMyC6acqKr+yF
	 4XXao8hIJ5Fx/gTKxXn8Fp4V4PuH9sAkKXzYUUCSfKYPD0U75j8KWp9C6ur/HxaPCVg==
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=ioGCE0az;
	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 3D177606A33A;
	Tue, 24 Nov 2026 12:02:56 +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=ioGCE0az
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=1795521770;
	b=AbAwkqm075XM45LHCLsnnQcffPDdmBhQVJrb/1MSU1zY9TVagaea9xkQBCja0klxZbE8
	 3Et+6edF5jetXsF/qf1rQEql0WxyMuwFF82V/M9GDcvWLhFMF8UqqSWWQUortkqSE31Mk
	 iXEdfI4zCMQqdOP5ImwbhG69LUiEWGz1sBqM+fMaoiS1bCzhl+crNr7+pVT0sdGuQ3FeE
	 EOyhkpnXpb+Xy4TevVK0m6idSE9+vXDxuQIkACxlMr/DG33weh01bOdh6cznrhGv8oDGn
	 I5kUx8LjjG3AG+PSr82qdb0H/oBl/vTOcDU8M1QWBthWe5KOWfHOf6NqE6CYIIPAXaA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795521770;
	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=J/hgjS5wptIfTKZPK4+3uy6djn7gSRXd68ZCyUQWT1s=;
	b=bs9XFgvdI3Gdvl3pMJCmOsHzODNCAhWRm5maTZblgOoywAqGK+MK3fK0WguuKlpac3q3
	 Q/POUiZpnhbAzLmUhq+kImkmc/zcY08mWiqkNTvV3U7vRtpRWSW3JQY2hs1ryFHfXJYzu
	 Qgnq+cJJ+YwUo4dQdkqAtliC0ba/zpVoDJQQP10L8NDeyifycBkPUS4kwxoWy9HReVc1L
	 X68s8DXtGEmr7fE43IqpOR2Sh0CU8Zx24Lgd6cgN6OsoXjdQvdNL+coq7f/7i09ADvfB7
	 z4vKhfT1ruB0ofVntjFngSnlvU0ZJGa6d6bYlK4cYERMTAIPzyvOnFlefZ19tIToJ2Q==
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=ioGCE0az;
	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 5BA24606A321;
	Tue, 24 Nov 2026 12:02:50 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00F871F000C4;
	Tue, 24 Nov 2026 12:02:48 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795521770;
	bh=J/hgjS5wptIfTKZPK4+3uy6djn7gSRXd68ZCyUQWT1s=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=ioGCE0azlO5MsbLAhAXe/NpXCbQDZ92w4JnRZeMVu3HYXUQ2KNxvTbKgzGIvAaxXY
	 KTLw3obuzH8WxJLY65CurHw8fBhzCpnGxFUsOKF5rvZcTLXaSJlJg6RYp5B+ReLQko
	 V7VoH1U5nYGURcrvgDjZacqo9x3mXZxd6tlXKigt0PydZDF1TAOrkjLoS3x9YUEM+R
	 NGaiQ/aUwST2MrCbHxJ30xOcEmd8EPpyxdJHWFdZZ+NKb+2YUxodn73hXR9xDgWBVW
	 q/d5bDgwa9m3Vukzx6ab2a+cyd1mMlFxGg4IGDxcPzcrU7Ekfw0QSNQjjVKeQvDMyH
	 avl9oHLBArTkQ==
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
 conor+dt@kernel.org, parthiban.veerasooran@microchip.com,
 hkallweit1@gmail.com, linux@armlinux.org.uk, marcelo.schmitt@analog.com,
 alvin.sipraga@analog.com, ciprian.regus@analog.com,
 Selvamani.Rajagopal@onsemi.com, netdev@vger.kernel.org,
 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261123115743.29523-6-iustin.stolniceanu@analog.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