Commit 348baefb authored by Charles Perry's avatar Charles Perry Committed by Jakub Kicinski
Browse files

net: macb: set default_an_inband to true for SGMII



Most platforms using GEM in SGMII mode use in-band autonegotiation
because it is on by default in GEM's 1G PCS and is always on since
commit e276e5e4 ("net: macb: Disable PCS auto-negotiation for SGMII
fixed-link mode"). Leave it on if possible using the "default_an_inband"
flag of "struct phylink_config" so that platforms that lack in-band
autonegotiation configurability at the PHY do not break with commit
1338cfef ("net: macb: fix SGMII with inband aneg disabled") which
will turn off in-band autoneg for non hot pluggable PHYs.

Once the majority of the PHY drivers that support SGMII have the
->config_inband() callback, this commit could be reverted so that non
hot pluggable PHY use outband negotiation with macb, like its the case
for other MACs.

Fixes: 1338cfef ("net: macb: fix SGMII with inband aneg disabled")
Reported-by: default avatarConor Dooley <conor.dooley@microchip.com>
Closes: https://lore.kernel.org/r/20260304-nebulizer-rounding-40fbc81a2ba1@spud


Signed-off-by: default avatarCharles Perry <charles.perry@microchip.com>
Tested-by: default avatarConor Dooley <conor.dooley@microchip.com>
Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20260313142140.4040647-1-charles.perry@microchip.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent dab177cb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1029,6 +1029,12 @@ static int macb_mii_probe(struct net_device *dev)
	if (bp->phy_interface == PHY_INTERFACE_MODE_SGMII) {
		bp->phylink_config.poll_fixed_state = true;
		bp->phylink_config.get_fixed_state = macb_get_pcs_fixed_state;
		/* The PCSAUTONEG bit in PCSCNTRL is on out of reset. Setting
		 * default_an_inband to true tells phylink to turn it off only
		 * if necessary (e.g. a fixed link or a PHY that doesn't support
		 * inband).
		 */
		bp->phylink_config.default_an_inband = true;
	}

	bp->phylink_config.mac_capabilities = MAC_ASYM_PAUSE |