diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-06-13 12:20:57 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-06-18 12:12:03 +0100 |
commit | 6345a365c12ea582b8d4fefd595aba8116064d01 (patch) | |
tree | 83544ed50866c64571d2f2e0407a1b24ff8750f2 | |
parent | e06128de198f450561f93f4bcd9eba2ac6b47220 (diff) |
net: phylink: fix SGMII inband autoneg enable
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.
Fixes: 92817dad7dcb ("net: phylink: Support disabling autonegotiation for PCS")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/net/phy/phylink.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 33c285252584..ecb8541de31c 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -3026,7 +3026,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; |