From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.2 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== 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== 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 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 ; Sun, 29 Nov 2026 16:13:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 10B9F606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=jwY/Vbmt 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= 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) Message-ID: <13337c63-1529-4347-b4a5-0d4e90c70d05@163.com> Date: Mon, 30 Nov 2026 00:12:29 +0800 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: phy: avoid synchronous module request in async probe context From: Hans Zhang <18255117159@163.com> To: Andrew Lunn 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 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> <04208d88-5611-4b08-b4a3-4030d75fa946@lunn.ch> <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com> Content-Language: en-US In-Reply-To: <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID:QCgvCgCXuJHoTgxrdS9pIw--.49117S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxAr45Kry5XFWUJFWUAryxZrb_yoW5tFyfpF W3JFWj9Fs8tr40vrZ7ua1YyFy0vw4rGa1Fgr95WryYv3W5Xr97JrW8ArWUZF1DCr15CFyI yr45Ja95Cay7AFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U5CzNUUUUU= X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC7AqrT2sMTur0NwAA3C 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