Skip to content

Commit

Permalink
net: phylink: fix SGMII inband autoneg enable
Browse files Browse the repository at this point in the history
When we are operating in SGMII inband mode, it implies that there is a
PHY connected, and the ethtool advertisement for autoneg applies to
the PHY, not the SGMII link. When in 1000base-X mode, then this applies
to the 802.3z link and needs to be applied to the PCS.

Fix this.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1o9Ng2-005Qbe-3H@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Russell King (Oracle) authored and Jakub Kicinski committed Jul 9, 2022
1 parent 40ad0a5 commit 6d1ce9c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/phy/phylink.c
Original file line number Diff line number Diff line change
Expand Up @@ -3040,7 +3040,9 @@ int phylink_mii_c22_pcs_config(struct mdio_device *pcs, unsigned int mode,

/* Ensure ISOLATE bit is disabled */
if (mode == MLO_AN_INBAND &&
linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, advertising))
(interface == PHY_INTERFACE_MODE_SGMII ||
interface == PHY_INTERFACE_MODE_QSGMII ||
linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, advertising)))
bmcr = BMCR_ANENABLE;
else
bmcr = 0;
Expand Down

0 comments on commit 6d1ce9c

Please sign in to comment.