Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Hans Zhang
Mon, 30 Nov 2026 02:37
[PATCH 2/4] net: ethernet: smsc911x: propagate mdiobus_register() errors
Author: Hans Zhang
Date: Mon, 30 Nov 2026 02:37
Date: Mon, 30 Nov 2026 02:37
26 lines
9259 bytes
9259 bytes
mdiobus_register() can return -EPROBE_DEFER. Return that error instead
of converting every failure to the initial -ENXIO so the driver can
defer correctly when probed from async context.
Signed-off-by: Hans Zhang <18255117159@163.com>
---
drivers/net/ethernet/smsc/smsc911x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 3ebd0664c697f..0d6d64b7c5010 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -1101,7 +1101,8 @@ static int smsc911x_mii_init(struct platform_device *pdev,
pdata->mii_bus->phy_mask = ~(1 << 1);
}
- if (mdiobus_register(pdata->mii_bus)) {
+ err = mdiobus_register(pdata->mii_bus);
+ if (err) {
SMSC_WARN(pdata, probe, "Error registering mii bus");
goto err_out_free_bus_2;
}
--
2.43.0
Re: [PATCH 2/4] net: ethernet: smsc911x: propagate mdiobus_register() errors
Author: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 02:46
Date: Tue, 01 Dec 2026 02:46
61 lines
10106 bytes
10106 bytes
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 commit message for "net: ethernet: smsc911x: propagate
mdiobus_register() errors" gives a reason for the change that the codeβ¦
--
net: ethernet: smsc911x: propagate mdiobus_register() errors
This patch changes smsc911x_mii_init() to return the error code from
mdiobus_register(). Before, every registration failure was turned into the
initial -ENXIO.
> mdiobus_register() can return -EPROBE_DEFER. Return that error instead
> of converting every failure to the initial -ENXIO so the driver can
> defer correctly when probed from async context.
[Severity: Low]
Is the "probed from async context" reasoning accurate here?
The driver core handles -EPROBE_DEFER the same way for synchronous and
asynchronous probing. In both cases really_probe() puts the device on the
deferred list. smsc911x_driver also does not set .probe_type:
drivers/net/ethernet/smsc/smsc911x.c:
static struct platform_driver smsc911x_driver = {
.probe = smsc911x_drv_probe,
.remove = smsc911x_drv_remove,
.driver = {
.name = SMSC_CHIPNAME,
...
For in-tree users, can mdiobus_register() return -EPROBE_DEFER at all?
smsc911x_mii_init() only sets mii_bus->parent, so bus->dev has no
fwnode/of_node.
That leaves two places in __mdiobus_register() that could defer:
devm_gpiod_get_optional(&bus->dev, "reset", ...)
and the per-PHY gpiod/reset lookups during the bus scan. Both depend on
board lookup tables keyed on names like "smsc911x-<id>" or
"smsc911x-<id>:01". A tree-wide search did not find any such tables.
The change itself looks like a reasonable cleanup. smsc911x_drv_probe()
now gets the real error (-EINVAL, -EIO, -ENOMEM, or -EPROBE_DEFER in
board-file or out-of-tree setups) instead of a fixed -ENXIO.
Could the commit message describe it that way and drop the async context
wording? That would keep the patch from being read as a fix for a real
deferral bug, for example when selecting stable backports.
The lantiq_etop and smsc9420 patches in this series use the same wording.
--
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130023745.820141-1-18255117159%40163.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads