1 From 99f5a98ae7df48a473a2c82145e83410a070b5c7 Mon Sep 17 00:00:00 2001 2 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org> 3 Date: Sun, 10 Jan 2021 00:29:41 +0100 4 Subject: [PATCH net-next 08/12] net: phylink: allow attaching phy for SFP 5 modules on 802.3z mode 6 MIME-Version: 1.0 7 Content-Type: text/plain; charset=UTF-8 8 Content-Transfer-Encoding: 8bit 9 10 Some SFPs may contain an internal PHY which may in some cases want to 11 connect with the host interface in 1000base-x/2500base-x mode. 12 Do not fail if such PHY is being attached in one of these PHY interface 13 modes. 14 15 Signed-off-by: Marek Behún <kabel@kernel.org> 16 Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk> 17 Reviewed-by: Pali Rohár <pali@kernel.org> 18 Cc: Andrew Lunn <andrew@lunn.ch> 19 --- 20 drivers/net/phy/phylink.c | 5 +---- 21 1 file changed, 1 insertion(+), 4 deletions(-) 22 23 diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c 24 index 9ff8eb516666..75464df191ef 100644 25 --- a/drivers/net/phy/phylink.c 26 +++ b/drivers/net/phy/phylink.c 27 @@ -1669,7 +1669,7 @@ static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy, 28 { 29 if (WARN_ON(pl->cfg_link_an_mode == MLO_AN_FIXED || 30 (pl->cfg_link_an_mode == MLO_AN_INBAND && 31 - phy_interface_mode_is_8023z(interface)))) 32 + phy_interface_mode_is_8023z(interface) && !pl->sfp_bus))) 33 return -EINVAL; 34 35 if (pl->phydev) 36 @@ -2918,9 +2918,6 @@ static int phylink_sfp_config_phy(struct phylink *pl, u8 mode, 37 return ret; 38 } 39 40 - if (phy_interface_mode_is_8023z(iface) && pl->phydev) 41 - return -EINVAL; 42 - 43 pl->link_port = pl->sfp_port; 44 45 phylink_sfp_set_config(pl, mode, support, &config); 46 -- 47 2.35.1 48