Article View: linux.kernel.netdev
Article #24236Re: [PATCH] net: phy: avoid synchronous module request in async probe context
From: Andrew Lunn
Date: Sun, 29 Nov 2026 21:05
Date: Sun, 29 Nov 2026 21:05
65 lines
11786 bytes
11786 bytes
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
Technical Details
Message-ID:
<fbb18cc8-9ea1-49f3-a550-98d7801baf75@lunn.ch>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373668-linux-kernel-netdev=dewy.ruReferences:
<0437f8be-41ca-4fb8-b775-ed02413ea16d@163.com> <24787f0c-e90e-45f1-a9f3-d0772fbafeaf@lunn.ch> <c1ee530d-21bc-4b50-881f-3be9b2654b9d@163.com> <04208d88-5611-4b08-b4a3-4030d75fa946@lunn.ch> <c0834daa-176e-454b-8408-3818ead9c688@163.com> <cc92cbe1-b65e-4fe8-be18-baae49dfb53b@163.com> <b01fa0aa-c669-4b2e-b7da-dfa75511621e@lunn.ch> <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com> <07b98d3c-c1c0-461e-8e38-8cdd29794b50@lunn.ch> <c29e6d11-bb3c-4a51-9d46-a01389cea3a4@163.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373668-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH] net: phy: avoid synchronous module request in async probe context Date: Sun, 29 Nov 2026 22:05:43 +0100 Organization: Usenet Network Message-ID: <fbb18cc8-9ea1-49f3-a550-98d7801baf75@lunn.ch> References: <0437f8be-41ca-4fb8-b775-ed02413ea16d@163.com> <24787f0c-e90e-45f1-a9f3-d0772fbafeaf@lunn.ch> <c1ee530d-21bc-4b50-881f-3be9b2654b9d@163.com> <04208d88-5611-4b08-b4a3-4030d75fa946@lunn.ch> <c0834daa-176e-454b-8408-3818ead9c688@163.com> <cc92cbe1-b65e-4fe8-be18-baae49dfb53b@163.com> <b01fa0aa-c669-4b2e-b7da-dfa75511621e@lunn.ch> <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com> <07b98d3c-c1c0-461e-8e38-8cdd29794b50@lunn.ch> <c29e6d11-bb3c-4a51-9d46-a01389cea3a4@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1261176"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:RQvkuZ4pWHi/5UdOCLJPeVtWnNI= sha256:A46frZ+prEGwi+b2wDgFJ1+EHnKbPWJYdJyF0GT+u7A= sha1:ImICtvfaXsi4ZUSnk0JG0HIfnYk= sha256:S3t6+zW2OAa+6sy2jej0vjvmsSJQmOUTqXWsFMLaLGc= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 7FEEC125FAF; Mon, 30 Nov 2026 00:06:22 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GbOR5AjrLNFR; Mon, 30 Nov 2026 00:06:18 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373668-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 74094125F08; Mon, 30 Nov 2026 00:06:08 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 3A4222311E; Sun, 29 Nov 2026 21:06:05 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795986365; b=brSscfJyXQzs1vrFJXpRSezZiZKJvurzvxSxE06GodQKGDpS5u5IUCuOE4fEtO+URsmw oIOhb7NCX9PzgjeUqmUWiUQF+mKkTu1Tcw/QKyw+dmzeMcoxR92XVmK6KJHl0vds5EkAa zBUihmcbB7FM8kVweOmMgY6ADOl7rJl26RqDIJu5e5Sdbq9CVy3g7tJ80Nbixlzvcw2PB G0ARJ6ugBfisKbk7SkgFPHK33zj/lbD3i0row0Y0pSa7RLt9QhmtLi/WYMIFVwFkNSGJN kkmNWlBTfE3kYBBN37EWzCPB7qd2/FukdCm2+drLT9ZMYnT8YT0+zMcespqa464bg5A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795986365; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=ZrbMZ27DpNJZxvyYce6CLmhXN6xMMoU0MvfefzGAxS8=; b=HnZ4qBGjrHfMz5naPN5gfjd+4dHK/eNFTqKkYcwdclw8/b4oPwwg8tGdIfGVq69P5+wm CQrEVR4h+PYz90eJEbLZV0PHgsimotB7m8A03v+5LZ4y4xe9A+n2TDm/kMZcLddchwzu5 mFfqzmrZJfDzsMCNmRkuwN/JBOSVLfLiCxaCpO5N9DzUoh1Fg8Th+bKA3FzHFNLgMAiBS r2+P/N/GsXi/Bhdgu0okAJx0vnEEVbz/RNdVfLRAbm9xQwfpcYCUzbpM5i5z1+0CNTKDz 9PJZcLgZVPsBVoS/bREwSzKpw5k/7aaXoq0iSVUdg8EM0qfqYVhiLRCDDAUDLuG8GpA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b="fwPAf/fj"; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FF89606A32D; Sun, 29 Nov 2026 21:06:05 +0000 (UTC) X-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 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-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== X-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== X-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 X-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 <netdev@vger.kernel.org>; Sun, 29 Nov 2026 21:06:03 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C1B05606A31C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-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=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xXm5f-002Cly-Hn; Sun, 29 Nov 2026 22:05:43 +0100 X-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> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <c29e6d11-bb3c-4a51-9d46-a01389cea3a4@163.com>