mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: f.fainelli@gmail.com
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
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	[thread overview]
Message-ID: <179483704808.3136.15887744025770615688@kernel.org> (raw)
In-Reply-To: <20261112045301.3669532-11-f.fainelli@gmail.com>

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

  reply	other threads:[~2026-11-16 13:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  4:52 [PATCH net v2 00/12] net: au1000: Bug fixes Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 01/12] net: au1000: recycle RX descriptors on allocation failure Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 02/12] net: au1000: clear all-multicast mode when restoring hash filtering Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 03/12] net: au1000: disconnect the PHY before freeing the MDIO bus Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 04/12] net: au1000: report MDIO transaction timeouts Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-12  4:52 ` [PATCH net v2 05/12] net: au1000: serialize TX completion with packet submission Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 06/12] net: au1000: assign a valid MAC address without platform data Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-12  4:52 ` [PATCH net v2 07/12] net: au1000: fix buffer descriptor free list insertion Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-12  4:52 ` [PATCH net v2 08/12] net: au1000: restore receive filtering before enabling RX Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 09/12] net: au1000: restore RX buffer addresses when restarting the MAC Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 10/12] net: phy: smsc: wait for LAN83C183 power-down recovery Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko [this message]
2026-11-12  4:52 ` [PATCH net v2 11/12] net: au1000: keep the MAC stopped until the PHY link is ready Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-12  4:52 ` [PATCH net v2 12/12] net: au1000: reject frames larger than the TX bounce buffer Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179483704808.3136.15887744025770615688@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=danny.kukawka@bisect.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=hvr@gnu.org \
    --cc=jeff@garzik.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=manuel.lauss@gmail.com \
    --cc=mmyangfl@gmail.com \
    --cc=mugunthanvnm@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=runyu.xiao@seu.edu.cn \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=shaojijie@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®