Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Hans Zhang <18255117159@163.com>
Cc: netdev-bot+sashiko@kernel.org, hkallweit1@gmail.com,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, linux@armlinux.org.uk, netdev@vger.kernel.org,
	Manivannan Sadhasivam <mani@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Shawn Lin <shawn.lin@rock-chips.com>
Subject: Re: [PATCH] net: phy: avoid synchronous module request in async probe context
Date: Sun, 29 Nov 2026 22:05:43 +0100	[thread overview]
Message-ID: <fbb18cc8-9ea1-49f3-a550-98d7801baf75@lunn.ch> (raw)
In-Reply-To: <c29e6d11-bb3c-4a51-9d46-a01389cea3a4@163.com>

On Mon, Nov 30, 2026 at 12:49:36AM +0800, Hans Zhang wrote:
> 
> 
> On 11/30/26 00:34, Andrew Lunn wrote:
> > > The phylib change does exactly that: __mdiobus_register() returns
> > > -EPROBE_DEFER and lets the driver core's existing deferred-probe mechanism
> > > do the re-probe, rather than spawning any workqueue in phylib or the MAC
> > > drivers. For the corner cases you raised, I audited the mdiobus_register()
> > > callers and found three that fold -EPROBE_DEFER into a hard -ENXIO:
> > > lantiq_etop, smsc911x and smsc9420; the 4-patch series fixes those alongside
> > > the __mdiobus_register() defer.
> > 
> > https://elixir.bootlin.com/linux/v7.3.4/source/arch/powerpc/platforms/pasemi/gpio_mdio.c#L244
> > 
> > The error message is no longer correct.
> > 
> > https://elixir.bootlin.com/linux/v7.3.4/source/drivers/net/dsa/mv88e6xxx/chip.c#L3896
> > 
> > Same problem,
> > 
> > https://elixir.bootlin.com/linux/v7.3.4/source/drivers/net/ethernet/altera/altera_tse_main.c#L158
> > https://elixir.bootlin.com/linux/v7.3.4/source/drivers/net/ethernet/arc/emac_mdio.c#L173
> > https://elixir.bootlin.com/linux/v7.3.4/source/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c#L236
> > https://elixir.bootlin.com/linux/v7.3.4/source/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c#L293
> > 
> > I will let you review all the calls to of_mdiobus_register().
> 
> 
> Hi Andrew,
> 
> Thanks, that's fair. I reviewed all the mdiobus_register(),
> of_mdiobus_register() and devm_mdiobus_register() callers, and the fallout
> from returning -EPROBE_DEFER splits into two classes:
> 
> Correctness: callers that discard the error and fold it into a hard
> -ENXIO/-ENODEV. Only three do that (lantiq_etop, smsc911x, smsc9420),
> which are already in the series; the rest propagate the error.
> 
> Logging: callers that dev_err()/netdev_err()/pr_err() on failure. They
> still propagate -EPROBE_DEFER, but the message becomes misleading and
> would spam on each defer. There are about fifty of these across net/dsa,
> net/mdio, net/ethernet, net/usb and a couple of arch callers, fixed by a
> mechanical dev_err() -> dev_err_probe(). Two of the links you posted
> (arc/emac_mdio.c and enetc's OF path) are already dev_err_probe() in the
> current tree; enetc's internal mdiobus_register() path still needs it.
> 
> Note that class 2 already mishandles -EPROBE_DEFER today via the reset-GPIO
> dev_err_probe() path in __mdiobus_register(), so it is a pre-existing
> cleanup independent of this change.
> 
> Would you prefer the whole thing as one series, or the core change
> (__mdiobus_register() defer plus the three correctness fixes) with a
> separate treewide dev_err_probe() cleanup series?

The mechanical change to dev_err_probe() within networking can be one
patch, in a series with the three changes for -ENXIO/-ENODEV.

For the arch changes, you need to submit them individually to the arch
Maintainers.

Once you have them all accepted, then please submit the phylib core
change to return -EPROBE_DEFER in async probe.

       Andrew

      reply	other threads:[~2026-11-29 21:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  7:07 [PATCH] net: phy: avoid synchronous module request in async probe context Hans Zhang
2026-11-25  7:37 ` netdev-bot+sashiko
2026-11-25  7:55   ` Hans Zhang
2026-11-25 13:58     ` Andrew Lunn
2026-11-26  3:52       ` Hans Zhang
2026-11-26 14:35         ` Andrew Lunn
2026-11-29  7:16           ` Hans Zhang
2026-11-29  7:46             ` Hans Zhang
2026-11-29 15:38               ` Andrew Lunn
2026-11-29 16:05                 ` Hans Zhang
2026-11-29 16:12                   ` Hans Zhang
2026-11-29 16:34                   ` Andrew Lunn
2026-11-29 16:49                     ` Hans Zhang
2026-11-29 21:05                       ` Andrew Lunn [this message]

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=fbb18cc8-9ea1-49f3-a550-98d7801baf75@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=18255117159@163.com \
    --cc=bhelgaas@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mani@kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shawn.lin@rock-chips.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