Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp585507rwl; Wed, 12 Apr 2023 00:50:00 -0700 (PDT) X-Google-Smtp-Source: AKy350bpLcMekeOkzhk5NODbxE6R65+SJrXLTDTqcC7qs/62AYHJxHLirpDspatMur/a8gam7VV6 X-Received: by 2002:a17:906:9f1f:b0:94e:6b3b:55 with SMTP id fy31-20020a1709069f1f00b0094e6b3b0055mr672989ejc.48.1681285799893; Wed, 12 Apr 2023 00:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681285799; cv=none; d=google.com; s=arc-20160816; b=uQea1dTyYc/sDZfHrlOd69O77HFy/b6egT13tyAPLhgWZ7gmEhMhLX2Llt3Q4yXiDg R4oiAlOvu1ToHpqpxV/qwFG6WFUBU4IaY8CjbDfBv7QSByUtxXt1Mv8yYxyZiCfAl4vr 4ZWXAWgqSTrY3Q2VX9atdC6FCZBPDcM3EDcW0RyjhaYUDKHJZeTeLRJxykCUZaFgEpu3 0VPalumKlpX5RRUR+AY7pXa7//gOE3hFxlvu41HSyX6OjnFjLgQvNSUowjIjT3XsWi4R Jka/J4j08juYKMqQk2fyH2bsbaUIxIP7hyGSbq2hBDogPeCxJqoXY81W2CxCpJhVv9CD 20Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CO47OM0miczfYcaLLJYgDjAY1lPzp2g2IISvLCCABNc=; b=n0r7IYkGWUdd1JdT/niK8I71zBAXnJ3OTyHbkEb62BxNeR+6xYSpTxS2TI6NZqQCJw rd3Mf0mf8tmLoM/0ZXUn1IHVNbnz41uwBQBfadhabwR2jXvL90uQhVh5MV+wsFaBOQNN J7539LHIz1FTADKdnZ33lFw9kvanIOSe6/iFqoRpBsRdyM9yAOP36x3oTwFkm0Je6Lsg lZnE3g+rIMrhMsSBYehQ53JNCCgMbQKhGAQrzdVvwOxaLiqfDoR2VacBau/sDKaKK4w9 9pUxp9Ft8MmvjhBuJMbQj2vmWpQumoiNqCOU5VKzSemorjOKXhuQwSKsPuKfAy4MOdht yiFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=P8YtNKGx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pv27-20020a170907209b00b0094a82dbdc61si526071ejb.304.2023.04.12.00.49.36; Wed, 12 Apr 2023 00:49:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=P8YtNKGx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbjDLHtD (ORCPT + 99 others); Wed, 12 Apr 2023 03:49:03 -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: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 == MLO_AN_FIXED || + if (pl->sfp_bus || + pl->cfg_link_an_mode == MLO_AN_FIXED || (pl->cfg_link_an_mode == MLO_AN_INBAND && phy_interface_mode_is_8023z(pl->link_config.interface))) return false; -- 2.39.2