🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17186

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

#17186
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 13:50
140 lines
12573 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0 (1)

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] In this commit, the new 500 ms wait in lan83c183_resume()
  (drivers/net/phy/smsc.c) runs only after the Au1000 MAC has already…

Pre-existing issues:
- [Low] After this patch, the SMSC_PHY Kconfig help text
  (drivers/net/phy/Kconfig:424) reads "Currently supports the LAN83C183,…

--

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

This patch adds a LAN83C183 entry to the SMSC PHY driver. Its resume
callback clears BMCR_PDOWN and sleeps for 500 ms, but only if the bit
was actually set. The aim is to let the MII clocks recover before the
Au1000 MAC starts when the MTX-1 interface is reopened.

Link: https://pdf.dzsc.com/LAN/LAN83C183.pdf#page=44

> diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
> index 30e9d22c8d1a3..10466b2574eb4 100644
> --- a/drivers/net/phy/Kconfig
> +++ b/drivers/net/phy/Kconfig
> @@ -421,7 +421,7 @@ config SMSC_PHY
>  	tristate "SMSC PHYs"
>  	select CRC16
>  	help
> -	  Currently supports the LAN83C185, LAN8187 and LAN8700 PHYs
> +	  Currently supports the LAN83C183, LAN83C185, LAN8187 and LAN8700 PHYs

[Severity: Low]
This isn't a bug introduced by this patch, but the help text still
names only some of the PHYs that smsc_tbl[] in drivers/net/phy/smsc.c
binds. It leaves out the LAN911x internal PHY, the LAN8710/LAN8720,
the LAN8740 and the LAN8741/LAN8742.

Could the list be completed while this line is being changed anyway?

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

[ ... ]

> @@ -684,8 +685,32 @@ 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);

[Severity: Medium]
The commit message says:

  Starting the Au1000 MAC before the MII clocks recover can hang the
  MTX-1 when reopening its interface.

Does this patch alone prevent that ordering? au1000_open() starts the
MAC before it calls phy_start():

drivers/net/ethernet/amd/au1000_eth.c:au1000_open() {
    ...
	retval = au1000_init(dev);
    ...
	if (dev->phydev)
		phy_start(dev->phydev);

	netif_start_queue(dev);
    ...
}

and au1000_init() already sets the RX/TX enable bits:

drivers/net/ethernet/amd/au1000_eth.c:au1000_init() {
    ...
	control = MAC_RX_ENABLE | MAC_TX_ENABLE;
    ...
	writel(control, &aup->mac->control);
    ...
}

Suppose a close has run au1000_close()->phy_stop()->phy_suspend()->
genphy_suspend(), which sets BMCR_PDOWN. The reopen then appears to go
like this:

au1000_open()
  au1000_init()          <- MAC RX/TX enabled, PHY still powered down
  phy_start()
    __phy_resume()
      lan83c183_resume()
        clear BMCR_PDOWN
        msleep(500)

If so, the 500 ms wait only delays the PHY state machine and
netif_start_queue(). The MAC has already started by then.

The close path has the same ordering in reverse. au1000_close() calls
phy_stop() before au1000_reset_mac_unlocked(), so the PHY powers down
while the MAC is still running.

The next patch in the series, "net: au1000: keep the MAC stopped until
the PHY link is ready", seems to fix this. It calls phy_resume() before
au1000_init() and enables RX/TX only after au1000_adjust_link() has
seen link up. It also calls au1000_hard_stop() on link down. In the
PHY_HALTED path, phy_link_down() runs before phy_suspend(), so the MAC
stops before the PHY powers down.

Can the MTX-1 reopen hang still happen when bisecting to this commit
alone? If so, could the commit message mention that it depends on the
au1000 change, or could the two patches be reordered?

> +
> +	return 0;
> +}

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112045301.3669532-1-f.fainelli%40gmail.com
Technical Details
Message-ID: <179483704808.3136.15887744025770615688@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364358-linux-kernel-netdev=dewy.ru
References: <20261112045301.3669532-11-f.fainelli@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364358-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 10/12] net: phy: smsc: wait for LAN83C183
 power-down recovery
Date: Mon, 16 Nov 2026 13:50:48 +0000
Organization: Usenet Network
Message-ID: <179483704808.3136.15887744025770615688@kernel.org>
References: <20261112045301.3669532-11-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="2076472"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:0hUnw/wL2CaBugI5UUpXacGDprA= sha256:VKlJ3a+/M6IF2G/om63no9QDCFd5qOX1XtsLuWlVlWM=
	sha1:sgDwcJ/TZ/5H2F+z+y1MUVVSeFk= sha256:zJU7EtOMfjCzlBg6Z2PNNdRX4lwdSi00BKYA+O9fxxU=
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 AEA13114C33; Mon, 16 Nov 2026 16:51:34 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 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, URIBL_BLOCKED=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 MjWbuYmGSmnM;
	Mon, 16 Nov 2026 16:51:29 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-364358-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 1A6EC114C0C; Mon, 16 Nov 2026 16:51:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 9B2C42E637; Mon, 16 Nov 2026 13:51:06 +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=1794837051;
	b=HEc+botwJC0IBeD+Sr7EEMZFhRqrVMQclYXm6S8WB6y4Ss1cUM7RNG49NJbHK0fI/ye8
	 3PB0T+qKVMFkdD64fyikUl97IX14a5k6GkfFwMzFC879VG+CHbuUUFJ1lT1/aWinfPbyv
	 ZvyQwxfE/l9yDtvxVDi62KiPXDqd23yMD/vBAoSubae1/o3WNVqLEwPTrQ81K2PPdlEIG
	 fonekgs5QYhwVIcoqJ3OsTn1gk7wcW4VgR0/TvTzsRt2W0uVsBmk7RRvtyPCVhxmvvW85
	 hUdF7/yGF+4YMD7sO64bgzLlrshzVJQtEFkUKCpyzn6xWuBA5PKiZQ1qPFXwFfV+mmg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794837051;
	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=LVz5mUCm5WEeoAL0Bw5uctiuDrK+oeS2W5aeRJYYK+M=;
	b=A/YjVU7YjlBPrLgbO5BmKW3KcR+3r/YVAULtkt98fsTkXYQdmS/t2IGyKScGXsEHVaDt
	 KAYAh7VKOg7u0VghgInqhKFwdLqtiQyv66wCKvaewEPrDct/KV2G2nNSCWCpTvAphyjF3
	 HM1MbrwnKfdtv3guUBrcsnhVChv7uwyxrJNEaNC09/LvQ/0fUBT5DAxXTmv6PnpOFxn1F
	 C1lP68X8L3r41iTYZnsi2bX4OJQcubpfoCkkYE7cdJmRPOrOogb3SLnzfTn7Nt3V9eWKa
	 mlNgjrvAM0eMoKeGlIDM38bcavlyvj/e5lFblClNeuHKT2SEU4du7ww5adyRJFb0cEQ==
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=KWY85mvC;
	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 DF2F960A2621;
	Mon, 16 Nov 2026 13:50:50 +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=KWY85mvC
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=1794837050;
	b=ge3tyyVcT+JhLfvVCYRApiGzY39vzzfx094KpmV4lUdGg9oGJwse08yivr70Mn2BFQhw
	 QToEqDnlaU1WSUVfRDhV+kCyV6X9dsJCo8TMDmSV7Yb5hvYY5dk7gZq9gI9vnQl+pS+FZ
	 HUVgW8eztIVwhLOoZpwEBe7SvtmEDhz7XL6dabQaOjckwOBJgzrCz/hexkOZLnER/tXu+
	 LGtOVYGNuYITIQLohVY2MZhfkqdakM7AKaAOudEs1cF/c4NmvRjHP9v0HUcJSkZXZvkkG
	 arwumO2qIjfx+GUS49qzyeJZIbHsX/fX8fjo/Y0c7PRpJyANP0SlpgebhK2xC6JZNsQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794837050;
	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=LVz5mUCm5WEeoAL0Bw5uctiuDrK+oeS2W5aeRJYYK+M=;
	b=UexT9k7gbS1OsrUczN0LUBxKsX4O9fHDgcEb8nmizAO+Ma8Xq6+izXCyA20GXMlRylsF
	 qi6uEqmJWjZ1tZZQMhpcMdtk1rl2HLDiGLkbEo8zwWiWrBE1+EfglFuZ8+y+wfLAECrs0
	 SyuKguoJ0v+uvoR3yWscygIJ0kKL44uyIwVSRUQ1QHwyVYPhNfiIaJ1PTr18RIv03rNRY
	 AzEA9sosJBQKgCtualdSNn5r8/Lgq8i3jNFIwCmLNk3LcuudepM2htbNwHclqF7ms2pRr
	 Lmk4aK6IYG0Ca1f+pAHFQ1Oi2dYWgrToKGW0sUaJEAu32alLiTERpJZdWy84nZbqD0Q==
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=KWY85mvC;
	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 0B602606A884;
	Mon, 16 Nov 2026 13:50:49 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 941B21F01821;
	Mon, 16 Nov 2026 13:50:48 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794837049;
	bh=LVz5mUCm5WEeoAL0Bw5uctiuDrK+oeS2W5aeRJYYK+M=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=KWY85mvCaXAjsH+NDQE9EI0nh5+7kxtEyJ9+nlDpboY3USL+cXfcr7YN3zcre90/x
	 EJig/+UoT24V0BOxqKuIsKXS/f70edfdZQ2nL3UijiDaXckvUxDqa/y0d0BlMK09NU
	 MVqq3Fp9SepW337AQu6MrwGgUXpbsVbxzye4vNA5MVvFCGZo0pmCiW8BQho2krLYKj
	 PRBw7N4GRd0IYJO/VinlJhVA5YNefJuuwdZdeRTcCn5A2F6HFkpGkakLjGBaMNCsli
	 vHDtB5jzIW9+W/jQsiyE1y/f9XlSB0RJ/lofOKQtdDeQ/vfYq+0EGNGBe35lMpELf+
	 lTOqtr/9l+i0g==
X-Cc: netdev@vger.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, horms@kernel.org,
 runyu.xiao@seu.edu.cn, mmyangfl@gmail.com, hvr@gnu.org, jeff@garzik.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: <20261112045301.3669532-11-f.fainelli@gmail.com>
X-sashiko-severity: Medium
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