Re: [PATCH net v3 08/10] net: phy: smsc: wait for LAN83C183 power-down recovery
From: Florian Fainelli
Date: Fri Nov 20 2026 - 19:26:07 EST
On 11/20/26 02:32, netdev-bot+sashiko@xxxxxxxxxx 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