From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.4 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== 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== 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 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 ; Sun, 29 Nov 2026 16:06:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 23AFC606A31C 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=CSgUw3p8 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= 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) Message-ID: <7a5a6aa7-d521-4346-b2f2-d3548d726d9d@163.com> Date: Mon, 30 Nov 2026 00:05:09 +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 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> Content-Language: en-US From: Hans Zhang <18255117159@163.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID:_____wD3P+cxTQxr0QWdKg--.13479S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJw1xGFWDJF1xAr1fWFyfZwb_yoW5Zr4kpF W3GryjkFs8tF40vrs7ZF4ayF18u3WfGa1Fgr9YgryYv3W5urnFqrW0yFW3XF1Dur15uFy2 yr45Ja95CayxAFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UYiihUUUUU= X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC6xM94GsMTTPCDQAA3z 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