From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795986364; b=Jp7kt3Heeb3z4YUwLJ8JOnNQ4gSo/9eNEr5riZWdL5wM/0MwSvqBP8QfWnM7IL2+vBGN tTB8jcHlkHuOAM2ILeO4r9i8tMGx6zfazmHmMGARxEpvaYKB6QVuAGodsp28/R7Krf8q2 LwU6/Zr3nXBuPVpgrZf0QU/2IQnQaEh4qHjTjLE2XbC6NP9+9lDEqBVk3xTJ2ukA8QDiv WnmVCW63ZZQruAFdwt70P6ioSBqBEGf91zAMY+yOrWJgWD8zVKNI745Cq17V+2DJoVRNk qnYk+L0UFnJJJylYdbPw4YW1nfu2SRea2qzW0OLNRdVG9gv3nB/mizcvNd+95kvINLg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795986364; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=ZrbMZ27DpNJZxvyYce6CLmhXN6xMMoU0MvfefzGAxS8=; b=ARpGsg2hy9O8OsStMh0pQJxitZiz25k1NXcWiIGzDclb7lYXPXg+JMZTpYOIQbW12Dzd jT+1Ob8ZevBf2cvmzKN0gKJqNWDnZaIShjZtzkSURM0gWm+jhyc5IIUHw89jPQhOVm3fq TyxSLEpQqL7sM2m/m6QMmqLHDbTdreyk9k9EL2XheaY8lJ5bcaPOtAdb+nAFXagfrvIMo dnqqYpoN+ZiiLvtbccfMqDfZcyrbz3va2gXpQTTcCVLUOVAnqwMMQphkXbvFsHLRYjAe9 /rvoIUEsVTtEBw/FPnXDe/YgmqlVa+No5F1WDqUdfbz25IzfYYnZAcH+icpiVNj+siA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b="fwPAf/fj"; arc=none smtp.remote-ip=156.67.10.101 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1B05606A31C for ; Sun, 29 Nov 2026 21:06:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C1B05606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=fwPAf/fj DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=ZrbMZ27DpNJZxvyYce6CLmhXN6xMMoU0MvfefzGAxS8=; b=fwPAf/fj4jhBjAvMVHy7CNmeZf 7nfF6WlhQDRQpN2bP5wP9DlW5++3ces7Qggy1lXwJf0CEIqqz0odfAqtNX7aWVsnFQaoSOwJ3pNuT RG8QSufAc2fY6xRNMCK55wGK9NGdp2AeE2sdgXbVhbxNgVp+zwGOBsOaHyYGYqJfdlec=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1xXm5f-002Cly-Hn; Sun, 29 Nov 2026 22:05:43 +0100 Date: Sun, 29 Nov 2026 22:05:43 +0100 From: Andrew Lunn 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 , Bjorn Helgaas , Shawn Lin Subject: Re: [PATCH] net: phy: avoid synchronous module request in async probe context Message-ID: References: <0437f8be-41ca-4fb8-b775-ed02413ea16d@163.com> <24787f0c-e90e-45f1-a9f3-d0772fbafeaf@lunn.ch> <04208d88-5611-4b08-b4a3-4030d75fa946@lunn.ch> <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com> <07b98d3c-c1c0-461e-8e38-8cdd29794b50@lunn.ch> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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