Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: 18255117159@163.com
Cc: andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	linux@armlinux.org.uk, netdev@vger.kernel.org
Subject: Re: [PATCH 2/4] net: ethernet: smsc911x: propagate mdiobus_register() errors
Date: Tue, 01 Dec 2026 02:46:31 +0000	[thread overview]
Message-ID: <179609319140.3146.359103272669840910@kernel.org> (raw)
In-Reply-To: <20261130023745.820141-3-18255117159@163.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 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

  reply	other threads:[~2026-12-01  2:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  2:37 [PATCH 0/4] prepare MDIO callers for -EPROBE_DEFER from __mdiobus_register() Hans Zhang
2026-11-30  2:37 ` [PATCH 1/4] net: ethernet: lantiq_etop: propagate mdiobus_register() errors Hans Zhang
2026-12-01  2:46   ` netdev-bot+sashiko
2026-11-30  2:37 ` [PATCH 2/4] net: ethernet: smsc911x: " Hans Zhang
2026-12-01  2:46   ` netdev-bot+sashiko [this message]
2026-11-30  2:37 ` [PATCH 3/4] net: ethernet: smsc9420: " Hans Zhang
2026-12-01  2:46   ` netdev-bot+sashiko
2026-11-30  2:37 ` [PATCH 4/4] net: use dev_err_probe() for MDIO bus registration errors Hans Zhang
2026-12-01  2:46   ` 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=179609319140.3146.359103272669840910@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=18255117159@163.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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