Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: f.fainelli@gmail.com
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
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	[thread overview]
Message-ID: <179634127797.3146.8972284829578542562@kernel.org> (raw)
In-Reply-To: <20261202224957.3043478-9-f.fainelli@gmail.com>

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

  reply	other threads:[~2026-12-03 23:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 22:49 [PATCH net v5 00/10] net: au1000: Bug fixes Florian Fainelli
2026-12-02 22:49 ` [PATCH net v5 01/10] net: au1000: recycle RX descriptors on allocation failure Florian Fainelli
2026-12-02 22:49 ` [PATCH net v5 02/10] net: au1000: clear all-multicast mode when restoring hash filtering Florian Fainelli
2026-12-02 22:49 ` [PATCH net v5 03/10] net: au1000: disconnect the PHY before freeing the MDIO bus Florian Fainelli
2026-12-02 22:49 ` [PATCH net v5 04/10] net: au1000: report MDIO transaction timeouts Florian Fainelli
2026-12-02 22:49 ` [PATCH net v5 05/10] net: au1000: serialize TX completion with packet submission Florian Fainelli
2026-12-03  7:26   ` Jijie Shao
2026-12-03 23:41   ` netdev-bot+sashiko
2026-12-02 22:49 ` [PATCH net v5 06/10] net: au1000: restore receive filtering before enabling RX Florian Fainelli
2026-12-02 22:49 ` [PATCH net v5 07/10] net: au1000: restore RX buffer addresses when restarting the MAC Florian Fainelli
2026-12-02 22:49 ` [PATCH net v5 08/10] net: phy: smsc: wait for LAN83C183 power-down recovery Florian Fainelli
2026-12-03 23:41   ` netdev-bot+sashiko [this message]
2026-12-02 22:49 ` [PATCH net v5 09/10] net: au1000: keep the MAC stopped until the PHY link is ready Florian Fainelli
2026-12-03 23:41   ` netdev-bot+sashiko
2026-12-02 22:49 ` [PATCH net v5 10/10] net: au1000: reject frames larger than the TX bounce buffer Florian Fainelli
2026-12-02 22:55 ` [PATCH net v5 00/10] net: au1000: Bug fixes netdev-bot+sinfo

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=179634127797.3146.8972284829578542562@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=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