From nobody Wed Feb 11 22:54:57 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E50D8C7619A for ; Wed, 12 Apr 2023 07:49:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229924AbjDLHtG (ORCPT ); Wed, 12 Apr 2023 03:49:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbjDLHtA (ORCPT ); Wed, 12 Apr 2023 03:49:00 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A40B455BB; Wed, 12 Apr 2023 00:48:58 -0700 (PDT) Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 7F04B4000E; Wed, 12 Apr 2023 07:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1681285737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CO47OM0miczfYcaLLJYgDjAY1lPzp2g2IISvLCCABNc=; b=P8YtNKGxa0ZteNm/HSo7UkplEN7TLavuugUsieYDZskuQgqyp6Ja97SogaYUcP2L8xSyBG qiB/c+iO6BHoZmha1EkOU0nqyUpXBxcNyrVIm+j68l6aFYhGAQIq5T/BZYDkwheVp5W10/ y4RuDXZUDf6yt2VcIIE0b1c2OknnwFY0Z9wEbvxXWkc4R+xTWGIe6YL+H6WqYTpvO2Op5a iMZjWcf0D1BVml4jZC3DDEcJYEiFl5z4579iaC6aYCuqEv2ouvvYHFoWgex6ybiOoF5HVj OewvemiOr+4AaS6Xgh1XopLYg0nWkiqCk9GDyQuGjq2XrR5v4d9hhFJozmGOhA== From: Maxime Chevallier To: davem@davemloft.net, Sit Michael Wei Hong , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , "linux-stm32 @ st-md-mailman . stormreply . com" , "alexis . lothore @ bootlin . com" Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org Subject: [PATCH net] net: phylink: check for SFP bus presence in phylink_expects_phy Date: Wed, 12 Apr 2023 09:48:50 +0200 Message-Id: <20230412074850.41260-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When an SFP bus is present, we don't expect a PHY to be attached directly from the MAC driver, it will be handled by phylink at SFP attach time. Fixes: 653a180957a8 ("net: phylink: add phylink_expects_phy() method") Signed-off-by: Maxime Chevallier --- This was tested on dwmac_socfpga, following discussion here [1] [1] : https://lore.kernel.org/netdev/PH0PR11MB758766370DD16A5107B1FAB69D9B9= @PH0PR11MB7587.namprd11.prod.outlook.com/ drivers/net/phy/phylink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index a4111f1be375..334018f1028d 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1594,7 +1594,8 @@ EXPORT_SYMBOL_GPL(phylink_destroy); */ bool phylink_expects_phy(struct phylink *pl) { - if (pl->cfg_link_an_mode =3D=3D MLO_AN_FIXED || + if (pl->sfp_bus || + pl->cfg_link_an_mode =3D=3D MLO_AN_FIXED || (pl->cfg_link_an_mode =3D=3D MLO_AN_INBAND && phy_interface_mode_is_8023z(pl->link_config.interface))) return false; --=20 2.39.2