Article View: linux.kernel.netdev
Article #24174Re: [PATCH] net: phy: avoid synchronous module request in async probe context
From: Hans Zhang
Date: Sun, 29 Nov 2026 16:12
Date: Sun, 29 Nov 2026 16:12
91 lines
12698 bytes
12698 bytes
On 11/30/26 00:05, Hans Zhang wrote: > > > 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? > Hello Mani, This is the thread for the discussion. https://patchwork.kernel.org/project/netdevbpf/patch/20261124070753.25972-1-18255117159@163.com/ Best regards, Hans
Technical Details
Message-ID:
<13337c63-1529-4347-b4a5-0d4e90c70d05@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-373563-linux-kernel-netdev=dewy.ruReferences:
<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> <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@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-373563-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:12:29 +0800 Organization: Usenet Network Message-ID: <13337c63-1529-4347-b4a5-0d4e90c70d05@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> <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1206659"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:bUG3t4XKn/w8RDKSZeEzAdMvwtE= sha256:omHtl0jKqsyHPBv0XOxpKySgsEzWW2T8L6gieYNXx78= sha1:THMgKxuqSpUJ9z3JOEjsuOB9jj0= sha256:Mu47dpGAjBpLu47QBAcSWqI04UQEYIvgJ1/saoQq/TI= 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 6F527125F98; Sun, 29 Nov 2026 19:13:48 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.717 X-Spam-Status: No, score=-2.717 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, 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 DUscHCzeavIF; Sun, 29 Nov 2026 19:13:44 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373563-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id CF27B125F96; Sun, 29 Nov 2026 19:13:35 +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 0E3AC23FC4; Sun, 29 Nov 2026 16:13:34 +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=1795968813; b=RSIrJBl1Dws05WpSvsp2tuU/feuYGQqxMuqTEla3TReEwWNXv9lBtJlE674ESbZ+UWKt scdI2E+Bz2Cs/wA2t9e6I1X7o2Y0jHyLGz9lWcB9lxDIHIqKVLT6CKCzeLxjmmIDOXomM OkIqDCyV6vo8NHilCdRLGzYIrK3hq8YQ367jE027j6ExVHeDCraoyqE66UDJjFHjA9wIq DcJ8mnaXtfGVtLQ9oRJXCbn0hvSYEqAd/TYDFToSQqJ2WFtWJXURyHpAvpxYC6JVnCzPx Bbqt+wGWx0oWOItl5b1MI3oTXnKl+nXtG55YCZQRStJjR8NKW24nIjCQNpFnh818mmw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795968813; 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:From:To:Cc:References:Content-Language:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-CM-TRANSID: X-Coremail-Antispam:X-CM-SenderInfo; bh=7zq+14Y4x1VH8JD8uk0sQQ1veMugE+3zQLzWRePo6Dc=; b=2E1BhAb8tzP9NrDVJPLAdRHWWtqHE5bfgng4SAdmuoI+JRJG28lH4y0DFtsYubvfNA7+ XjI4fWiW191mUeMteqftJ+lQMUHeOB9QDcsfq4tneGkzJWEtUGS3tkxGGfJSCoYmjlsbO RUzKCo3ya8BOu3Rk8a1+L3t6uVl+1OnvINfPAD+U5BxEw7wSEZzpeNzWAFC63fPr92TDD d7NBO8VxPsnx0Ugkkd7TqgoHjScKqkn3Z1NiJQ0YG7MUGdnLic1W04UjBfP7XdUVfqTgg rHK61G1p7WxIj0K9y4f7jOeV9vzoGV7pTQfNBAFkl/0EU6JCdjkxMRlONytoYazVIcg== 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="jwY/Vbmt"; 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 DA4F1606A32C; Sun, 29 Nov 2026 16:13:33 +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=jwY/Vbmt X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.2 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795968813; b=hCkFJ/2WkQflQfgeykDa6uSTC0tCRwfuqjCt/s2dxTzENaEgfXOw/MZW+wXEDggKRrGj fnjnRY4XtqUl4SJPHr6Fsw5x8GsMKen20sfo5nFd7SqGRzcv5qEGQOVnOhwTGdYZlvo/r fqaUu+bpZMZeJvsbhDd4cDLzAS4/ngXNuh5m+Y29rkHqeZoun0+NYw4wLmirFzGj2+2kP /+F6tYZHPWHAfjkU1JUMNKpv1t3sawPmc/fF504kgm1iCR9heT1ehDvp4EIIyBq7FLU7z bp/vRUr4KCyzFbyNX34PwDJoFbpI5M4RJlwCaYhy/jYSlg0y5AYPTYgZdSq1QC6K1Qw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795968813; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:From:To:Cc:References:Content-Language:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-CM-TRANSID: X-Coremail-Antispam:X-Originating-IP:X-CM-SenderInfo; bh=7zq+14Y4x1VH8JD8uk0sQQ1veMugE+3zQLzWRePo6Dc=; b=t+/D6iqoVJUjsvZ2ISavCWfVs04+Vu0N/mmIGUrwY7uDf/YIwfuWz3sGHVERfbnW0gOh OY72hUNKloNbknJftkNJGgPnSqV8r05a0xzWRQ8tcx4V5jTje93VILDKxTQMJVuw49vvB fJjUQ3ZaJ/VYzMcL/SBd6gG4QN1mhx76ANPjfjdOCWIMQawXJFwRHbrfhCtEIpPgmPs11 y2DGSrBEmByrljVEb0i0AikKJjhaKRS1Jd/AxDfKMuLwhFFnYBuR/e2lba1xvPeTc+8m+ tf2XTmI3Z99qd8o4dqlAP/8FJu89FdGWlWVnDshI8o+jJEECaX/mPVV14+d/IRb+HIw== 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="jwY/Vbmt"; arc=none smtp.remote-ip=220.197.31.2 X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.2]) (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 10B9F606A31C for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 16:13:30 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 10B9F606A31C 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:From:To: Content-Type; bh=7zq+14Y4x1VH8JD8uk0sQQ1veMugE+3zQLzWRePo6Dc=; b=jwY/VbmtQFEhCDOhsO5S7SzhXTZvkoDrNxC3yxEUXkZxFOUAkO907zg88tMHOC QhR/d0JWkg1R+3P8Gaw/rnGUMxATQWqQ3M6SLxd8bIbDXWi4jyeYZs+UMcOOzD3s 06a3MK+7PHYTaITEtZPRppBuU+208PHH9u8TcPF+3Wx3c= X-Received: from [IPV6:240e:b8f:91b3:d000:2f3a:64db:294e:7919] (unknown []) by gzsmtp5 (Coremail) with SMTP id QCgvCgCXuJHoTgxrdS9pIw--.49117S2; Mon, 30 Nov 2026 00:12:25 +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: <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com> X-CM-TRANSID: QCgvCgCXuJHoTgxrdS9pIw--.49117S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxAr45Kry5XFWUJFWUAryxZrb_yoW5tFyfpF W3JFWj9Fs8tr40vrZ7ua1YyFy0vw4rGa1Fgr95WryYv3W5Xr97JrW8ArWUZF1DCr15CFyI yr45Ja95Cay7AFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U5CzNUUUUU= X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC7AqrT2sMTur0NwAA3C