From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (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 BA7B2390C90; Mon, 1 Jun 2026 09:32:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.13.80.246 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780306329; cv=none; b=Zc6uPGO8K915pk5W2vUL6HULnjonLoRfIXbaA+ZiJzsZMgUCd0E2N27zSm1b6bFzss3FDs8IIaSlQm3fDgZqWFObXAiD1kcNB0yb46plpz8DEPO9c0yA6jaX0ej1nsaUJ1hus7GxV0cCueTiEKFusFnSZJmGa5bOruLL8HJkIuQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780306329; c=relaxed/simple; bh=LqTRlHOp0YHQMBHFAbPqweqf7FuVo4edHss2+mASmZc=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type; b=LlYZo/vFFIy9QkX7gFWjhMclhtR+e7JUkQTEZBH1m4KdLrkkyiuLgsfDP70qxMEklEdnABAGkFsFP5qYFck/N6uUFPo+kArh9VdBMChYFui+/cq/wx/EWSJIlz5w5uscB9/KfN8cYF+fB7DDPKAZvdDSzD6uMucH/eHVkkoM1eo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b=ag/zJ4no; arc=none smtp.client-ip=194.13.80.246 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b="ag/zJ4no" Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D289DA01FB; Mon, 1 Jun 2026 11:32:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1780306326; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=p7m2ZvTWTpUZsSq2QqocuRSjvRDnNfWr7agiHb4ZjBI=; b=ag/zJ4nogUjrZK2L8q75HmD8aaNXznIk/rxYhiKIKB9IQ9KyiydYqi8gw470gMedsn7gAi F6ZniM/Rjpj0fbRwxaDwyPRuXlhvzGiVXAT16z+n+bFqPDt+P/7k0R+5jZ/zHH4VmJab+n 3gixl8E090c5PcY5LlALb+HXicBnnbZF/w1dxSIoZcErvcx+vq6awhFvpy+fhtH4+OcwUb pkFfoINQO68bsVyS2vG7zpcbS3HhuTVTg0i/nSfO4UGmfPyteO9g5HBbRY30NPOSLrOXUJ K6u9T6KmtqvDDo/wc3Lyqhe2oFpvIszqz5H8yhsiV0e4e8bBoVghD1KT/MIMwg== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 01 Jun 2026 11:32:05 +0200 From: Nicolai Buchwitz To: Maxime Chevallier Cc: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Heiner Kallweit , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com Subject: Re: [PATCH net v2 3/3] net: phy: don't try to setup PHY-driven SFP cages when using genphy In-Reply-To: <20260601084029.815461-4-maxime.chevallier@bootlin.com> References: <20260601084029.815461-1-maxime.chevallier@bootlin.com> <20260601084029.815461-4-maxime.chevallier@bootlin.com> Message-ID: <090d7e9be921e62b94812785d1d8f54c@tipi-net.de> X-Sender: nb@tipi-net.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 On 1.6.2026 10:40, Maxime Chevallier wrote: > We don't have support for PHY-driver SFP cages with the genphy code. > > On top of that, it was found by sashiko that running > sfp_bus_add_upstream() for genphy deadlocks, as for genphy the PHY > probing runs under RTNL, which isn't the case for non-genphy drivers. > > This problem was reproduced, and does lead to a deadlock on RTNL. > > Before the blamed commit, the phy_sfp_probe() call was made by > individual PHY drivers, so there was no way to get to the SFP probing > path when using genphy. > > Let's therefore only run phy_sfp_probe when not using genphy. > > Fixes: bad869b5e41a ("net: phy: Only rely on phy_port for PHY-driven > SFP") > Signed-off-by: Maxime Chevallier > --- > drivers/net/phy/phy_device.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > 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(). > + */ > + 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); Reviewed-by: Nicolai Buchwitz Thanks Nicolai