From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECBD43DDDA5 for ; Thu, 4 Jun 2026 07:28:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780558095; cv=none; b=l3YBY0ByOlZ9WMiChJ5yadZDqdiHjdo35HplHnf7RTvEqlPkCcnJ/6VIWi+oGpgkWgIAK65HD6ZCoYzPaV7a95gGk/t264wVYo+yy2Cjzv2mCRnQky5FHWVurMxrOd2Na19H+lXKXBlERsL2pOb36su83SRi+OkPkpWtX3R0QLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780558095; c=relaxed/simple; bh=OQ2CY/I0RuEA9zQmRMG9+3p2eLTqmrVvYmFTN9Bnbbg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qTps2YyHV10LqgoElMetmjc+uukxDBLGHlL7/H+hE8/VL47VpYcp6L5FasAV06IiCoDeeY+MG80ByZTtepcel1k/rQZGnPEnbryGGdamgO7r7xXCKn7zmcw8R+LtjV4+aZpP1PDOt/tZjVl131/x+E6Ocdx1v8ACsTXc329VvOo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=OnGzAOeU; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="OnGzAOeU" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id AD8184E40505; Thu, 4 Jun 2026 07:28:12 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 81A8D5FEF7; Thu, 4 Jun 2026 07:28:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0DD2E106A1767; Thu, 4 Jun 2026 09:28:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780558091; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=z+NfAZ+z731qUJUIS44wvo1vE8Ea95Oiw6x09RDCHYA=; b=OnGzAOeUiUy7biv3gzeHPnFEeJIJu6BYie5ooL/HZiyD4GdGMA5E8p81vnwhlLwYoATmIm P0yTD6a24LVpP/ikkDMCFFGFsvIvGJq7Jrd/+S+6pgbuIa+mLbMuSKClkqjNvMkoQZO7xe TgLzAEt6k8pLr3h4ZjBobn4TGGNXMb55cR6iQevZp6Vv9OG/U8EuJ6JBXWH0tpdq8kCcsb AsdLynXBa3R+NQhqsQYUTQgymcrAQiY3deMfH7pVKBLJnRuvkMCC/WVWshrc9SMDcEfYe+ 4KV66dglT/bs8tkE4thF1O8m3WtjCbgxRRUH5bwUTitSXysZX3PgtN8Ne5iubw== Message-ID: <82b0be82-5b1b-4204-8a93-a2a3d06af9c2@bootlin.com> Date: Thu, 4 Jun 2026 09:28:08 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v2 3/3] net: phy: don't try to setup PHY-driven SFP cages when using genphy To: Jakub Kicinski Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk, hkallweit1@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com References: <20260601084029.815461-4-maxime.chevallier@bootlin.com> <20260604022729.2925198-2-kuba@kernel.org> Content-Language: en-US From: Maxime Chevallier In-Reply-To: <20260604022729.2925198-2-kuba@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 On 6/4/26 04:27, Jakub Kicinski wrote: > This is an AI-generated review of your patch. The human sending this > email has considered the AI review valid, or at least plausible. > --- > net: phy: don't try to setup PHY-driven SFP cages when using genphy > > This change skips phy_sfp_probe() when the genphy driver is bound, > avoiding an RTNL deadlock in sfp_bus_add_upstream() since genphy > binding runs under RTNL while non-genphy driver binding does not. > >> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c >> index a171cbe2a74a..8eace58e9f12 100644 >> --- a/drivers/net/phy/phy_device.c >> +++ b/drivers/net/phy/phy_device.c >> @@ -3512,9 +3512,14 @@ static int phy_setup_ports(struct phy_device *phydev) >> if (ret) >> return ret; >> >> - ret = phy_sfp_probe(phydev); >> - if (ret) >> - goto out; >> + /* We don't support SFP with genphy drivers. Also, genphy driver binding >> + * occurs with RTNL help, wich will deadlock the sfp_bus_add_upstream(). > ^^^^ > > [Low] > There is a typo in the new comment, "wich" should be "which". Sure thing, I need to respin anyway, let me fix this :) Maxime > >> + */ >> + if (!phydev->is_genphy_driven) { >> + ret = phy_sfp_probe(phydev); >> + if (ret) >> + goto out; >> + } >> >> if (phydev->n_ports < phydev->max_n_ports) { >> ret = phy_default_setup_single_port(phydev);