🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24334

Re: [PATCH] net: phy: avoid synchronous module request in async probe context

#24334
From: Hans Zhang
Date: Mon, 30 Nov 2026 02:55
87 lines
12801 bytes

On 11/30/26 05:05, Andrew Lunn wrote:
> 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.



Hello Andrew,

Thanks for the guidance. I've sent the networking part as a four-patch
series:

   net: ethernet: lantiq_etop: propagate mdiobus_register() errors
   net: ethernet: smsc911x: propagate mdiobus_register() errors
   net: ethernet: smsc9420: propagate mdiobus_register() errors
   net: use dev_err_probe() for MDIO bus registration errors

and sent the powerpc/pasemi gpio_mdio dev_err_probe() change separately
to the powerpc maintainers.

Once those are accepted, I'll submit the phylib core change that makes
__mdiobus_register() return -EPROBE_DEFER in async probe context.

Best regards,
Hans
Technical Details
Message-ID: <9688640a-e430-4a80-b93a-ac956a9d617e@163.com>
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-373795-linux-kernel-netdev=dewy.ru
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> <fbb18cc8-9ea1-49f3-a550-98d7801baf75@lunn.ch>

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-373795-linux-kernel-netdev=dewy.ru
From: 18255117159@163.com (Hans Zhang)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] net: phy: avoid synchronous module request in async probe
 context
Date: Mon, 30 Nov 2026 10:55:29 +0800
Organization: Usenet Network
Message-ID: <9688640a-e430-4a80-b93a-ac956a9d617e@163.com>
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>
 <fbb18cc8-9ea1-49f3-a550-98d7801baf75@lunn.ch>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1316142"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:zKooSV4QZgp3OgQ2wyAceqNpc34= sha256:yNEUKPSEzpFYI683P14f2AslvlDLgN+3G+nmBi3Pwyo=
	sha1:rsNsUtzx25sGTwEFF7IeA/z5obY= sha256:aAONLgsPNcXkd+bCN2QA9sP25bRrhMMviB7bLGnmDiI=
Content-Language: en-US
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 072CA125FB8; Mon, 30 Nov 2026 05:56:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.817
X-Spam-Status: No, score=-2.817 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
	FROM_LOCAL_DIGITS=0.001, FROM_LOCAL_HEX=0.331,
	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]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=163.com
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 fINsf0Iyg9C3;
	Mon, 30 Nov 2026 05:56:34 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-373795-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=163.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 1E5D8125FB3; Mon, 30 Nov 2026 05:56:26 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id AC569600A0B; Mon, 30 Nov 2026 02:56:25 +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=1796007383;
	b=HTNMOfnLEVhgA5bodtmAiBXRc5xHB/hallA81HAel6Fx6gJJFaP3UcYd+WLUu9vYHE1y
	 yYYIJiwBCmLGSsCTT0CPd0lxC9MRgiXAr2lEzSQWK4DykMETDUDTJ5ZENg08mdncXfb8m
	 ULXZDDz6sP3Ee+88wVUxJ4IwiB/D6KKqMfF48+Id+3Bsw6U2aQ696h37MknVGf/m6zN7i
	 5IPm7IA98ufrBe1qUzj76SGtSYycnSR+oW4/IOFOQ/O5Q5XXSjnep2qT9Qy8ZpFX3lCfU
	 tc716V9GMgxkSG1OchliBXlFvEsJwZqV1kbX/SGAkAuhIIKhjvm+C8ajprPb/DtYXbQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796007383;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding:X-CM-TRANSID:
	 X-Coremail-Antispam:X-CM-SenderInfo;
	bh=qap5II/8UVg/nRxzNQlOj/RqXXwhbtS8zn3zsykPBZ0=;
	b=CfYgqrFMGxGS0VCYkskS3+1I5OeE3lizyNLeRVRC1mtid+R8rkSSK4RkXwBWV1J0nnro
	 YNbovg1XgSEAGDI0Ex47O313ZnPXndmxOVbvq4bpjnTGl+rrKHKK5qe6je7C6o5CEuVNE
	 mbc/VfVwesL+DatVmzUjeHjEPnxsEkVjW0k021yUZ1F+8XzRy9sapofyExf4hHniy1Oi4
	 cF8JthjVGrh/wFQ5lTC1mKvoyd3f9LSfWWd53Vrf6Yam/T0qMJVNce/4KwH5MBLffyE/L
	 hJDs+8uV5QMuKvliGTBtsfeYRgbu4RqJU5+RT13pQ27CfwXAfsGFsEfoRvjIhtnZOiA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b="a+1H/cyE";
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	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 EE0EA606A680;
	Mon, 30 Nov 2026 02:56:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=a+1H/cyE
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.3
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796007382;
	b=OkbNANrfbaalxbYK/N13Y24z33VXhBTxn4V5M52P0xdLpz6VYvq4lWiW+j4nQBOC7iyl
	 t4Jl03dKTy2/CCSyL9E0QtveJbfYzzNSU66d1Wo+FzYGEwBjp3i11zCxMpFeHzzE8SNlJ
	 oTR51DysXyS4TafVJl3W1hnU103E+JC7l4TedftlKtfmZ6iHlyzQTJ4nQKwcDWaJ4ZWem
	 TwtWjxRXyVbHJRt7Z33vYAJLppXNc8p2LV6bUUqZvno6oKrOHn3Xx6mtbVIYfNMabBR5z
	 RTnxVA6M/B6qt0W3jRk2Fif4GByMg8X4lWTu6NFjVnUPXcLyec3eWFVuqJVtp6xejgg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796007382;
	h=DMARC-Filter:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding:X-CM-TRANSID:
	 X-Coremail-Antispam:X-CM-SenderInfo;
	bh=qap5II/8UVg/nRxzNQlOj/RqXXwhbtS8zn3zsykPBZ0=;
	b=EBLcOmAdKUoZyYJs4KWD9P9H0ogQuWOmxcFANVucRq1HGDxS4pXqY+YJRHcP9N8OdH1X
	 fYWjiA3a3YeQVHshumKSPw8rxRNpn+n9NMGeWvaK0hWoLhfH5b8bLn37p9IUdoPE0f0TV
	 YDusT9nV8H4FdF08+WBj1lCMj5ZJ0r2M5HlJmqnDysCQlHC5c4xv0zYgl7+GYLuv+LNP3
	 u7ik7YzSiT07xbfm0ArOdEVyEV2Ml0mnbcl9HL1ieX/UZbmBM4r3AcRp7EFC337DdaCj1
	 3+eii3e2N9KFzpzQpCwhuRIVt/MWLXknC5xBtTmdjjIlTxhjDFR0iddtpA6gX9cvsmA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b="a+1H/cyE";
	arc=none smtp.remote-ip=220.197.31.3
X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6726E606A31D
	for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 02:56:18 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6726E606A31D
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;
	s=s110527; h=Message-ID:Date:MIME-Version:Subject:To:From:
	Content-Type; bh=qap5II/8UVg/nRxzNQlOj/RqXXwhbtS8zn3zsykPBZ0=;
	b=a+1H/cyEypmfEb46ds+IYk6xylYkSJe4f+s75q+jGpnyo2zmSYQ/BR7FrIEK9W
	s3svArI2c+bEfpqMfmLJfuD9tNgNC2qSAI1GfY94qRfLE1znKUvYABA1dpJ2yQxZ
	+KO0HphKZbYcY5SHyKCGCXFq/ceIifm62VrEGnsUJ5ZWM=
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-User-Agent: Mozilla Thunderbird
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-In-Reply-To: <fbb18cc8-9ea1-49f3-a550-98d7801baf75@lunn.ch>
X-CM-TRANSID: _____wD3v9Cm5Qxrb4rkLA--.43681S2
X-Coremail-Antispam: 1Uf129KBjvJXoWxWry8GF4UtF1UKr13Zr48Xrb_yoWrXr4Upa
	9xXa4Yvr4Dtr4fZa92k3W8AF9Yv3WfKrWUWr15W345Zwn0vry8Ar48GFW7urnrWr48C3W7
	tF1Yqa1UAan8Aw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U5sqAUUUUU=
X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC7AiBJWsM5agK4gAA3C