From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 807D7C77B6E for ; Wed, 12 Apr 2023 07:49:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=x8T+IrBFURhlVvNANgs3wKevQVWg8204aTvF6Vfv6Uo=; b=0NSiiK9RkFYH/h DMnJVefExGyg4mjiaTNckqcy2jDRY8Cj+2wrws5JqDm8eAbU1U3Jk9ARPwnyq3l+/M/wK3OerKkpV VpVNnFpHcDCXUPImm3cTSw8sOKEUo+sDR6cCc/QWq8GmAkc+Qq5XfNFSjqXG49+bdwCQwvjft2/IX ryLzYhAnU8BQ2uzXIrDRyWsC7Hrko/yvsaBrpG91eg7DM8p/5bmRwDJ09BDJHkOlhauD0a8aoJzfY TtHYTaSqqNTDNnPgLN8aCt1vZ293Yvwzmnggg2RHIxbIlS+9PqCNPwSLFeVinp1yVMud23HaWg9pV Ce/NKnnZwW2PvU6cwTRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmVDy-0029UR-20; Wed, 12 Apr 2023 07:49:02 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmVDv-0029TL-0t for linux-arm-kernel@lists.infradead.org; Wed, 12 Apr 2023 07:49:00 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230412_004859_473682_BE9EA019 X-CRM114-Status: UNSURE ( 9.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel