Skip to content

Commit 31eb890

Browse files
elkablodavem330
authored andcommitted
net: phylink: allow attaching phy for SFP modules on 802.3z mode
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 <[email protected]> Reviewed-by: Russell King <[email protected]> Reviewed-by: Pali Rohár <[email protected]> Cc: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d6d2929 commit 31eb890

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/net/phy/phylink.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy,
16691669
{
16701670
if (WARN_ON(pl->cfg_link_an_mode == MLO_AN_FIXED ||
16711671
(pl->cfg_link_an_mode == MLO_AN_INBAND &&
1672-
phy_interface_mode_is_8023z(interface))))
1672+
phy_interface_mode_is_8023z(interface) && !pl->sfp_bus)))
16731673
return -EINVAL;
16741674

16751675
if (pl->phydev)
@@ -2918,9 +2918,6 @@ static int phylink_sfp_config_phy(struct phylink *pl, u8 mode,
29182918
return ret;
29192919
}
29202920

2921-
if (phy_interface_mode_is_8023z(iface) && pl->phydev)
2922-
return -EINVAL;
2923-
29242921
pl->link_port = pl->sfp_port;
29252922

29262923
phylink_sfp_set_config(pl, mode, support, &config);

0 commit comments

Comments
 (0)