From patchwork Fri Sep 30 14:21:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12995543 X-Patchwork-Delegate: kuba@kernel.org 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 04E60C433FE for ; Fri, 30 Sep 2022 14:22:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232072AbiI3OWU (ORCPT ); Fri, 30 Sep 2022 10:22:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232076AbiI3OVq (ORCPT ); Fri, 30 Sep 2022 10:21:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A13AB1A4096 for ; Fri, 30 Sep 2022 07:21:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 99A7962364 for ; Fri, 30 Sep 2022 14:21:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68007C4314E; Fri, 30 Sep 2022 14:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664547690; bh=O9I9OeUiBL2Ok/YnRDiiyywtJH2aj4nUsHhv8RuYc5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HC8LJm8StXM2B/uQe65f6IUcZ89wgyuVG655gKAzwjhOGsK6LfT5+lHjufLBmUoxo u+A025FZVJtS5i8XussGDAM6vPRgAYRDmCjq//ZqIffnsb3t2p6cIWjaPL5Ulq8Brp Xna7R4lFi7zAWBXOkQpKuTk1xkLMczYI0vWOPyQMpBhlc6akEK+3BCWRdqAy7QKrQD u6Vjrbm+/4+Fx1dpzLODOePCFSUmtvwdWZmtUlTARWf4ZagL7yxPy8mFgyGs1JdQP4 RZNC2BGd7q/BYskVgLNlW/OgtgtshbIbvVXunnAQUJD5ewURGAZoXu5OSefUDv+8E/ 2n9IPGSUS9YMg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski Cc: Russell King , Andrew Lunn , Vladimir Oltean , =?utf-8?q?Marek_Beh=C3=BAn?= , =?utf-8?q?Pali_Roh=C3=A1r?= Subject: [PATCH net-next 08/12] net: phylink: allow attaching phy for SFP modules on 802.3z mode Date: Fri, 30 Sep 2022 16:21:06 +0200 Message-Id: <20220930142110.15372-9-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220930142110.15372-1-kabel@kernel.org> References: <20220930142110.15372-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Some SFPs may contain an internal PHY which may in some cases want to connect with the host interface in 1000base-x/2500base-x mode. Do not fail if such PHY is being attached in one of these PHY interface modes. Signed-off-by: Marek Behún Reviewed-by: Russell King Reviewed-by: Pali Rohár Cc: Andrew Lunn --- drivers/net/phy/phylink.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 9ff8eb516666..75464df191ef 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1669,7 +1669,7 @@ static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy, { if (WARN_ON(pl->cfg_link_an_mode == MLO_AN_FIXED || (pl->cfg_link_an_mode == MLO_AN_INBAND && - phy_interface_mode_is_8023z(interface)))) + phy_interface_mode_is_8023z(interface) && !pl->sfp_bus))) return -EINVAL; if (pl->phydev) @@ -2918,9 +2918,6 @@ static int phylink_sfp_config_phy(struct phylink *pl, u8 mode, return ret; } - if (phy_interface_mode_is_8023z(iface) && pl->phydev) - return -EINVAL; - pl->link_port = pl->sfp_port; phylink_sfp_set_config(pl, mode, support, &config);