๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26608

Re: [PATCH net v5 08/10] net: phy: smsc: wait for LAN83C183 power-down recovery

#26608
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 23:41
132 lines
12291 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 500 ms recovery wait exists only in lan83c183_resume() in
  drivers/net/phy/smsc.c.
- [Low] The new smsc_phy_driver entry matches phy_id 0x0016f840 with mask
  0xfffffff0 (LSI/SEEQ OUI 00:a0:7d, model 4).

--

net: phy: smsc: wait for LAN83C183 power-down recovery

This patch adds an smsc PHY driver entry for the LAN83C183. Its PHY ID,
0x0016f840, is shared with the LSI L80227. The new resume callback clears
BMCR_PDOWN and sleeps 500 ms only when the bit was actually set. This lets
the MII clocks recover before the Au1000 MAC restarts, and is one half of
the fix for the MTX-1 reopen hang.

Link: https://pdf.dzsc.com/LAN/LAN83C183.pdf#page=44
Link: https://datasheet.octopart.com/L80223-LSI-datasheet-11757091.pdf#page=73

> diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
> index 48487149c2252..c0713017e54b0 100644
> --- a/drivers/net/phy/smsc.c
> +++ b/drivers/net/phy/smsc.c

[ ... ]

> @@ -684,8 +685,33 @@ int smsc_phy_probe(struct phy_device *phydev)
>  }
>  EXPORT_SYMBOL_GPL(smsc_phy_probe);
>  
> +static int lan83c183_resume(struct phy_device *phydev)
> +{
> +	int ret;
> +
> +	ret = phy_modify_changed(phydev, MII_BMCR, BMCR_PDOWN, 0);
> +	if (ret < 0)
> +		return ret;
> +
> +	/* The PHY needs up to 500 ms to restore operation after power-down. */
> +	if (ret)
> +		msleep(500);
> +
> +	return 0;
> +}

[Severity: Low]
The delay in lan83c183_resume() only runs if the smsc driver is already
bound when the au1000 MAC attaches the PHY. Does anything in Kconfig make
sure of that?

MIPS_AU1X00_ENET in drivers/net/ethernet/amd/Kconfig has no reference to
SMSC_PHY:

config MIPS_AU1X00_ENET
	tristate "MIPS AU1000 Ethernet support"
	depends on MIPS_ALCHEMY
	select PHYLIB
	select CRC32

The PHY is attached at platform probe time through
au1000_probe()->au1000_mii_probe()->phy_connect(). If smsc.ko is not loaded
by then, phy_attach_direct() falls back to genphy without any warning:

drivers/net/phy/phy_device.c:phy_attach_direct() {
    ...
	if (!d->driver) {
		if (phydev->is_c45)
			d->driver = &genphy_c45_driver.mdiodrv.driver;
		else
			d->driver = &genphy_driver.mdiodrv.driver;
    ...
}

genphy_resume() returns as soon as BMCR_PDOWN is cleared. Loading smsc.ko
later does not rebind the PHY, so the reopen hang can still happen. One way
to hit this is MIPS_AU1X00_ENET=y with SMSC_PHY=m and no initramfs that
loads smsc.ko first.

The in-tree defconfigs do not match the setup used for validation:

- arch/mips/configs/gpr_defconfig sets CONFIG_MIPS_AU1X00_ENET=y and
  CONFIG_SMSC_PHY=m. I have not checked whether the GPR board uses this
  PHY.
- arch/mips/configs/mtx1_defconfig sets CONFIG_SMSC_PHY=m and does not
  enable MIPS_AU1X00_ENET at all.

The commit message does document the CONFIG_SMSC_PHY=y requirement. Could
the configuration enforce it as well? Possible options:

- add "imply SMSC_PHY" to MIPS_AU1X00_ENET
- add "select SMSC_PHY if MIPS_MTX1" to MIPS_AU1X00_ENET
- update mtx1_defconfig to build both the MAC and SMSC_PHY in

>  static struct phy_driver smsc_phy_driver[] = {
>  {
> +	/* LSI/SEEQ OUI 00:a0:7d, model 4; shared with L80227. */
> +	.phy_id		= 0x0016f840,
> +	.phy_id_mask	= 0xfffffff0,
> +	.name		= "SMSC LAN83C183",

[Severity: Low]
This isn't a bug, but since this ID also matches the LSI L80227, should
the driver name and the SMSC_PHY help text mention it?

As written, an L80227 shows up as "SMSC LAN83C183" in phylib attach
messages and in sysfs.

The help text in drivers/net/phy/Kconfig, under the "SMSC PHYs" prompt,
now reads:

	  Currently supports the LAN83C183, LAN83C185, LAN8187 and LAN8700 PHYs

So nothing tells someone with an L80227 board that SMSC_PHY now binds
their PHY and adds the 500 ms power-down recovery delay.

> +
> +	.get_features	= genphy_read_abilities,
> +	.suspend	= genphy_suspend,
> +	.resume		= lan83c183_resume,
> +	.set_loopback	= genphy_loopback,
> +}, {

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202224957.3043478-1-f.fainelli%40gmail.com
Technical Details
Message-ID: <179634127797.3146.8972284829578542562@kernel.org>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376905-linux-kernel-netdev=dewy.ru
References: <20261202224957.3043478-9-f.fainelli@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376905-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v5 08/10] net: phy: smsc: wait for LAN83C183
 power-down recovery
Date: Thu, 03 Dec 2026 23:41:17 +0000
Organization: Usenet Network
Message-ID: <179634127797.3146.8972284829578542562@kernel.org>
References: <20261202224957.3043478-9-f.fainelli@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2630060"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:E7a1XUz48FfAxTB57dAZStJOG9k= sha256:sXWt/xEgWV0mapyFoSRgnKhzfjougs2hz/DCjeaxXMk=
	sha1:L5oyE+y57mIWbi0gEIDli74/h/E= sha256:O7hxz6kR162Z5XJoa0yPJ/DC38n7FhP4Brn5qpOFV+g=
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 B2C16117A70; Fri,  4 Dec 2026 02:41:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.64
X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, 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 EetXzZRGKK7T;
	Fri,  4 Dec 2026 02:41:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376905-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 EEA50117A6F; Fri,  4 Dec 2026 02:41: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 A316C2AE28; Thu,  3 Dec 2026 23:41:30 +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=1796341290;
	b=JFjjMrkQcvqtFLO1gYqQ5p18DJqC6U7+18zos5jpxTLgKN5DhifNnx/BL7LYbfuAwF9m
	 lDN02PIbuBv/L6onyhHAQJbRmQNN8/Ve0ZNylY0zAA4yKBy+SSnrV4tonzd1k1ECxi8Kv
	 yqjtR2aK6Z1QuqHbiKrpq9El/a8i5EqSMak1xYlh0oTJtllud3jkM+9MgzGzE+RFs2K0D
	 NZNW6tXpGwgbrYlQICcqNPfSjR/DH1fm/HKQzk58YbemUqFNnP4Mg5y8H6OkRuEvbKt0s
	 K2punZ84wvmmd3LngnZjKrcWdVx5Z0EnlqSS9vRfUpJa9NGw2kvhoeuu3vkM/+cjbwA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796341290;
	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=EWCmt9Uej1pB0cry4mWyON5yFVI0WcndROn9sCU8Qfg=;
	b=NjfIKvrPgz6hvQGEI7G3SCdbVrU/LqoynnYp2vG+6WhwlknDwn8ER9/K2A1usVW0s7Iq
	 WuGup/0oYCugifVwp3G57xI/KVC257bFF/hDURW1cqfLZ/sPa7EMF/G4N59cnNqR7gd6m
	 Y5D6xml0eSw0qENSbyPquvdiGqsXqMhl7PlE9Ap30IRvufYipYgjbilr4/ybptUxR6mHP
	 jI7x5AP1YxyH951nQnI5P/o0OC52q/ZJMvG9pUcyKX99K36FODJHvT517wNl748Wm3/az
	 ThKCoCcG3GgtgJ8FtLGCDq9j9dkjRkYYpLhmRGEgcpThVnNQDANWByOEmLOrDdAmdkw==
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=hniGfiFY;
	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 76378606A335;
	Thu,  3 Dec 2026 23:41:30 +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=hniGfiFY
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=1796341279;
	b=pMMj0CTOd1FLzQiTwgzoJTeyGHSARqmc2e08NLSSaFil3g+bx5F9uAg8O+ynTajlzgxm
	 m5ZUUkJDrKxp/3H3suyxG00CysVmELU4QzZQ92BnwM8sQq22mzpifp4JFfXyCWaGS68uF
	 WiYLeRjeDj7UWEqPSBRzqqMHRhtwBYGBs7yLk1tt9pvBY9f42FYiM7eLItO4V8uMONq+s
	 UEe2mQjmbu3tQ3mzHIBPEoJFEF9z0XM7Q9n6aZpQXgfWEfcqrWcwg9AjTZ27mukIFfYLT
	 JaLyFs7eVoA77X1HTvmLezjuMRkjdTrvAVOej9Ww0ZgfM/6qfEcSC2GLGLA8RFK01FA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796341279;
	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=EWCmt9Uej1pB0cry4mWyON5yFVI0WcndROn9sCU8Qfg=;
	b=S0kHGJv80HztTQfbe5rAlXHKF5qBd5d47qsXBJ37BVdlb+uSTvmGXt2dmz9NxTsUsdpP
	 +MO1aJ+mg/IMeG0uqapQhA8PuMItsTJ+tQNrfggnfBac+OjenVkABqXpTG+U9RZV058T/
	 QYz/RCxM8s/44gKzlx6ZnRSoWwxb+wFuVEXxQEIQZke4hA1E1jHSl0/Ayt7l7F0KvKKI1
	 JR9oIZYtbH4SC6BSpxDHT5tOL8sndhE8FwbeeoHfoxDaTQrVX4VphWNzt1fQPSUCUDNO1
	 v7NIxkzsVAmYtZv+Z5R5sVmUSGpI6O+rtJ4tL8HWAfI/Ju3v59Ce32FDAtmKvr2DTuw==
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=hniGfiFY;
	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 94DCE606A33E;
	Thu,  3 Dec 2026 23:41:19 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 634B01F000C2;
	Thu,  3 Dec 2026 23:41:18 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796341279;
	bh=EWCmt9Uej1pB0cry4mWyON5yFVI0WcndROn9sCU8Qfg=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=hniGfiFYVTFP+Kblt4xOmqgPJ4m/z3Bl1bpEGYNuMb64oV+Sn329KpXALbB2a6ng6
	 QK18nt3OkZwx4zVSfkPfN9v2km+FawHrS6E32UScB1PUoEhwuPcuiCX1Xh8xwr4uov
	 vhA1yZ7OKUaI7Lp+ZZpD7xIrGGbbBMXybY1Lx+XBvwuJiD23v8Asgo4vFTxvBFBc5n
	 wFr+bCsWFU2rCKL3WgR8NoGcDZsGjGUbO2U8PLI8KlCLc2Rq6sEnVYtkLFvAoLM+D4
	 nVJ0qq8YWDC0du96L9cRZ65wmFgvbwhV6w4c2bmm6CsOvo1f2bCjbZBR9p/ZJiaHY9
	 glc90WxYRiqvw==
X-Cc: netdev@vger.kernel.org, horms@kernel.org, andrew+netdev@lunn.ch,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 hkallweit1@gmail.com, linux@armlinux.org.uk, shaojijie@huawei.com,
 runyu.xiao@seu.edu.cn, mmyangfl@gmail.com, hvr@gnu.org,
 danny.kukawka@bisect.de, mugunthanvnm@ti.com, sebastian.hesselbarth@gmail.com,
 linux-kernel@vger.kernel.org, manuel.lauss@gmail.com
X-In-Reply-To: <20261202224957.3043478-9-f.fainelli@gmail.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