🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24171

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

#24171
From: Hans Zhang
Date: Sun, 29 Nov 2026 16:05
78 lines
12320 bytes

On 11/29/26 23:38, Andrew Lunn wrote:
>> Hi Andrew,
>>
>> After testing PROBE_FORCE_SYNCHRONOUS on the r8169 MAC driver, the WARN
>> still fires. The trace still starts at async_run_entry_fn and goes
>> through the parent Sky1 controller probe, so a child driver's probe_type
>> does not move it out of the async context.
> 
> I suggest you work on this. This seems like a driver code bug, or
> maybe a PCI bug. PROBE_FORCE_SYNCHRONOUS should be respected.
> 
> As far as i know, there is nothing which requires a subsystem to
> support async probe. It is an opt-in option. I'm not sure phylib can
> be made to work in async mode. Here is a reply to a different thread,
> which explains some background how phylib probes drivers:
> 
> https://patchew.org/linux/20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com/20261109-device-trust-core-v2-10-3b12d9a9f861@nvidia.com/
> 
> Scroll down to  "Maybe some background will help".
> 
> 	Andrew


Hello Andrew,

I dug into the driver core to check this. PROBE_FORCE_SYNCHRONOUS only
makes driver_allows_async_probing() return false, so the child is probed
inline in the first pass of __device_attach(); it cannot move the probe 
out of the parent's async context. r8169's probe runs inline inside
sky1_pcie_probe() because pci_bus_add_devices()/device_add() is called 
from within that async worker, so the trace starting at 
sync_run_entry_fn is expected rather than a driver or PCI bug.

This is also how the driver-core folks see it. In a recent thread [1],
Danilo Krummrich puts the same constraint:

"we are already in async context at this point and can't magically go 
back to initcall context."

and the PROBE_FORCE_SYNCHRONOUS documentation explicitly carves out the
deferred-probe case:

"with the exception of -EPROBE_DEFER handling - re-probing always ends 
up being done asynchronously".

In that thread Robin Murphy and Danilo point at the deferred-probe
mechanism as the appropriate tool, and Manivannan (PCI) adds:

"I'd love to handle this corner case in the driver core and not spawn a
workqueue/thread in the bus drivers as we would end up duplicating it 
all over defeating the purpose of PROBE_PREFER_ASYNCHRONOUS flag."

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.

A fully general driver-core fix may be the eventual endgame, but for the
phylib case this is the minimal, sanctioned mechanism. Would you prefer 
the phylib defer (with the caller fixes), or should this wait for a
driver-core-level change?


[1] 
https://lore.kernel.org/driver-core/gm7p37yom64doo3bbrcri3chbrzpm5zifqk256qqla2krhrrrw@tknda7rvjklv/


Hello Mani, this is your previous reply. I wonder what your opinion is 
on this?

Best regards,
Hans
Technical Details
Message-ID: <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373560-linux-kernel-netdev=dewy.ru
References: <20261124070753.25972-1-18255117159@163.com> <179559227928.3135.10596298102368144827@kernel.org> <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>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373560-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 00:05:09 +0800
Organization: Usenet Network
Message-ID: <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com>
References: <20261124070753.25972-1-18255117159@163.com>
 <179559227928.3135.10596298102368144827@kernel.org>
 <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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1204076"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:gN2bJ2NUJ9m8jhHNNT4Rk5DH9Qo= sha256:UcX/qIXrM4d//835E1lcDlREiKRda1RKqLlDF459KTM=
	sha1:YVO5ZilhXDv4veoWypOkmQe5skI= sha256:1Qc1sxlQXjVQ7UaGVNojMuytzyrlEg4B+gyyVmYmQc0=
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 AC9F1125F9A; Sun, 29 Nov 2026 19:06:31 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.816
X-Spam-Status: No, score=-2.816 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,
	URIBL_BLOCKED=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 jZO3LDjb7qF0;
	Sun, 29 Nov 2026 19:06:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-373560-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 56C15125F98; Sun, 29 Nov 2026 19:06:17 +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 5E7F2600D99; Sun, 29 Nov 2026 16:06:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1795968376;
	b=gK7Je8XPQxelMNikvO3bvvZ9bNi96SM4uTJgrFyRXf1WUgbv8PdBEKzCoMJk5um6xg21
	 Mw0xDnO2VmVb5LgY9XVymHKy3/yJG5YEO5MHlqlSNOrzYom8LldX0PmUM/HsM/FrJq2fW
	 pVH9eZj08BBcHfNybUWHopA4Kl3fJgu0eoJL9sutvle0DJXN+gB+BaEjotzmFzHN7+kfu
	 dzngW0J24Me4+OmPyeZnvySXE6O7FNuQeVcUqAVGR66pcGXMzgiqZKz2/2Ryhqhw/wcZ9
	 wYW1o/HIOlfU7QtbwIXeAIu4bZ9KxdHtu6o7BYL1VgQJujmhqRPblPClZvLVAcCo0jg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795968376;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:
	 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=rvbhiICL92MCRF4auWkQ6NnHQ7Gufgm4wlonoQ4G4Rk=;
	b=r7qG53jHmAYP/WeL6TGdXzmxkd7tC9FJkyllmC+ewixfxXV2sfhj4Cd2UcYhKyOE+ktQ
	 d+VK3q3/Te8K0+PcsX4wiHGui/k0Z6yrImusfE+moEmq3BejDrXj8qb+3WtgDJSgo4cZG
	 +y8R7ExxAmFyW/hveCWa799SobOi/2nlUSw/hk4vCQtT31BRE93Y1HNIHkjrWAziV1flF
	 2y9R6ZPBXkZ6dC+f467uG/xRU9rSzXq+2W2jTcxmZewW3TCl834gwLRUFYT6Zl8O9BsWJ
	 ZveyfxT6VzuZIir6u8NwKoI6sLUEcOYjqzLSlFQh7D5OcSpDkSUf2lU6frqZ9ucty3w==
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=CSgUw3p8;
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	arc=fail 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 BD60A606A32C;
	Sun, 29 Nov 2026 16:06:16 +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=CSgUw3p8
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.4
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795968375;
	b=xYNZqH+4Hpbbfl+QOByT9WQ/131exWUWikvM7wDyd2svn+PHoWyW+Via5/eETAJ1kRYo
	 TIue3+eKY1yvJwZ1iSZOH9wi+EPLcnoAgGDanxuFDt5GHgn3oIgpB4s6LpSHHabV6O5g8
	 uOX80M1vQtgju2iMORC5Ebjiq550z6zfgqJTRQ+d6Pd8oSoIdmUPLRZN4qeiFakGjdebt
	 68mtx232Y72MT0dkUcfc8rTezAwDsxCevn0AxM5h/pWFh88Rh5pnHaPGIU8+locs0w5Wm
	 nva71Rdwrk7FH6BNnHiedF9F60vK88zXtw+CHG2sJgUkETX1MmjJLO7/kaO5yM00lTw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795968375;
	h=DMARC-Filter:DKIM-Signature:Received: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-Originating-IP:X-CM-SenderInfo;
	bh=rvbhiICL92MCRF4auWkQ6NnHQ7Gufgm4wlonoQ4G4Rk=;
	b=0eHr37K+vBZNoBXaxEukZTWYcMGmCI2Ak2CDSHnWD9bsoH7KXxqT36sKyn71d+Ssv1yR
	 Kwkp32H0dTPf/GH3JdhSjG7hAChx/7Qk1ePE1qGS49+RobVL+bqlW1cl1OCK/bZ7FWvoJ
	 tgYXoVTcot6wjEfJBWhId6yqbeGRlMtw7dEm/erMzMk7q0/6aAk4g93uq4oziY7RsUfsH
	 Iw2znfHkPq0ShL0nbNC3UxK7KY3SXkhMdA2rWZVg6+RAHTEqNpAm4Jny/mb6s0FVGe9a4
	 WAyBF6qPWPJ/J9ZeMGQ0QUYM/VEerDs3ncFx0YBMUzBkVf1EHwNg4WwykHr0XFWgpmA==
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=CSgUw3p8;
	arc=none smtp.remote-ip=220.197.31.4
X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.4])
	(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 23AFC606A31C
	for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 16:06:12 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 23AFC606A31C
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=rvbhiICL92MCRF4auWkQ6NnHQ7Gufgm4wlonoQ4G4Rk=;
	b=CSgUw3p8HSLJCJsvYxcX8OdmVTbLey40ybpXyYle2Ddo85NNhHTd8PgUdPs2FX
	Mp8IYPw0i+iicRXB5B370TeS7mOor+q1Cn5Nyusx5K+TCBMGM/uGR/Bn4FCSldTZ
	i5FcKCzsVVXsbNTMKb652NJCLXm0a+tfATSVBrpNDd6Gc=
X-Received: from [IPV6:240e:b8f:91b3:d000:2f3a:64db:294e:7919] (unknown [])
	by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wD3P+cxTQxr0QWdKg--.13479S2;
	Mon, 30 Nov 2026 00:05:05 +0800 (CST)
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: <b01fa0aa-c669-4b2e-b7da-dfa75511621e@lunn.ch>
X-CM-TRANSID: _____wD3P+cxTQxr0QWdKg--.13479S2
X-Coremail-Antispam: 1Uf129KBjvJXoWxJw1xGFWDJF1xAr1fWFyfZwb_yoW5Zr4kpF
	W3GryjkFs8tF40vrs7ZF4ayF18u3WfGa1Fgr9YgryYv3W5urnFqrW0yFW3XF1Dur15uFy2
	yr45Ja95CayxAFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UYiihUUUUU=
X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC6xM94GsMTTPCDQAA3z