Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.3 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== 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== 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 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 ; Mon, 30 Nov 2026 02:56:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6726E606A31D 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=a+1H/cyE 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= Message-ID: <9688640a-e430-4a80-b93a-ac956a9d617e@163.com> Date: Mon, 30 Nov 2026 10:55: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 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: <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> <07b98d3c-c1c0-461e-8e38-8cdd29794b50@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:_____wD3v9Cm5Qxrb4rkLA--.43681S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxWry8GF4UtF1UKr13Zr48Xrb_yoWrXr4Upa 9xXa4Yvr4Dtr4fZa92k3W8AF9Yv3WfKrWUWr15W345Zwn0vry8Ar48GFW7urnrWr48C3W7 tF1Yqa1UAan8Aw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U5sqAUUUUU= X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC7AiBJWsM5agK4gAA3C 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