Netdev List
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev-bot+sashiko@kernel.org
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, danny.kukawka@bisect.de,
	mugunthanvnm@ti.com, sebastian.hesselbarth@gmail.com,
	linux-kernel@vger.kernel.org, manuel.lauss@gmail.com
Subject: Re: [PATCH net v3 08/10] net: phy: smsc: wait for LAN83C183 power-down recovery
Date: Fri, 20 Nov 2026 16:25:53 -0800	[thread overview]
Message-ID: <a3b7204f-8483-4fcb-9ff6-fe62c16d9592@gmail.com> (raw)
In-Reply-To: <179517075993.3136.6152160672961651320@kernel.org>

On 11/20/26 02:32, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
> 
> Critical: 0 · High: 0 · Medium: 1 · Low: 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] The 500 ms recovery delay in lan83c183_resume() only runs if
>    drivers/net/phy/smsc.c is the driver bound to the PHY when au1000_eth…
> - [Low] The new smsc_phy_driver[] entry and smsc_tbl alias match phy_id
>    0x0016f840 with mask 0xfffffff0.
> 
> --
> 
> net: phy: smsc: wait for LAN83C183 power-down recovery
> 
> This adds a LAN83C183 entry to the smsc PHY driver. Its resume callback
> sleeps 500 ms after clearing BMCR_PDOWN, which is the power-down recovery
> time given in the datasheet. Together with a companion au1000 patch, it is
> meant to fix an interface reopen hang on the MTX-1 board.
> 
> Link: https://pdf.dzsc.com/LAN/LAN83C183.pdf#page=44
> 
>> 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]
> Does this delay actually run on the MTX-1 board that the series targets?
> 
> lan83c183_resume() only runs if smsc.c is the driver bound to the PHY when
> au1000_eth attaches it. The attach happens at MAC probe time. That is
> still true after the companion patch, which only adds phy_resume() in
> au1000_open():
> 
> au1000_probe()
>    au1000_mii_probe()
>      phy_connect()
>        phy_attach_direct()
> 
> If no specific driver is bound yet, phy_attach_direct() falls back to
> genphy:
> 
> 	if (!d->driver) {
> 		if (phydev->is_c45)
> 			d->driver = &genphy_c45_driver.mdiodrv.driver;
> 		else
> 			d->driver = &genphy_driver.mdiodrv.driver;
> 
> arch/mips/configs/mtx1_defconfig sets CONFIG_SMSC_PHY=m and does not
> enable CONFIG_MIPS_AU1X00_ENET at all. Other Alchemy defconfigs, such as
> gpr_defconfig, set the MAC to =y alongside SMSC_PHY=m.
> 
> Take a built-in MAC with no initramfs. At probe time, the request_module()
> in phy_request_driver_module() can't load smsc.ko. genphy then stays
> bound until detach, and loading smsc.ko later does not rebind the PHY.
> 
> In that case resume goes through genphy_resume() with no wait, and the
> reopen hang would still be there.
> 
> Should the commit message or the series say that SMSC_PHY has to be built
> in (or included in the initramfs)? Or should mtx1_defconfig be updated to
> match?
> 
>> +
>> +	return 0;
>> +}
>> +
>>   static struct phy_driver smsc_phy_driver[] = {
>>   {
>> +	.phy_id		= 0x0016f840,
>> +	.phy_id_mask	= 0xfffffff0,
>> +	.name		= "SMSC LAN83C183",
> 
> [Severity: Low]
> Is 0x0016f840 specific enough to SMSC parts?
> 
> This ID does not carry SMSC's OUI, unlike the neighbouring entries.
> phy_id >> 10 gives 0x5be, which corresponds to SEEQ Technology's OUI
> 00:a0:7d. The existing SMSC entries give 0x1f0 (00:80:0f). The model
> number is 4.
> 
> The ID is correct for the LAN83C183. drivers/net/ethernet/smsc/smc91x.h
> defines:
> 
> #define PHY_LAN83C183	0x0016f840
> 
> That looks like a licensed SEEQ/LSI core inside the LAN91C111.
> 
> Any other SEEQ/LSI PHY that reports the same OUI and model 4 would now
> autoload smsc.ko through the new smsc_tbl entry. It would bind as
> "SMSC LAN83C183" instead of genphy. It would also get the 500 ms
> msleep() in lan83c183_resume() every time BMCR_PDOWN is cleared. The
> LSI 80227 may be one such part, though this tree does not confirm it.
> 
> Also, this isn't a bug, but the new entry has no OUI/Model# comment,
> while the other entries do.
> 
>> +
>> +	.get_features	= genphy_read_abilities,
>> +	.suspend	= genphy_suspend,
>> +	.resume		= lan83c183_resume,
>> +	.set_loopback	= genphy_loopback,
>> +}, {
> 
> [ ... ]
> 

Agreed on the binding prerequisite. Our MTX-1 tests used 
CONFIG_MIPS_AU1X00_ENET=y and CONFIG_SMSC_PHY=y, and the boot logs 
confirmed attachment to the SMSC LAN83C183 driver.

I have updated the commit message to make this requirement explicit. For 
early boot with a built-in MAC, SMSC_PHY should also be built in. 
Modular configurations must ensure that smsc.ko is loaded before PHY 
attachment; merely including it in the initramfs or loading it after 
genphy has attached is insufficient.

Regarding the ID, the LAN83C183 and L80227 manuals both specify OUI 
00:a0:7d and model 4, so the overlap is real. I added a comment and 
documented that the match also applies the conservative 500 ms 
power-down recovery delay to the L80227. The entry otherwise uses 
generic PHY helpers and performs no SMSC-specific register programming. 
Hardware validation remains limited to the LAN83C183; I have not tested 
the L80227.

pw-bot: cr
-- 
Florian

  reply	other threads:[~2026-11-21  0:25 UTC|newest]

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

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=a3b7204f-8483-4fcb-9ff6-fe62c16d9592@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=danny.kukawka@bisect.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --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-bot+sashiko@kernel.org \
    --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