* [PATCH net-next v2] net: macb: set default_an_inband to true for SGMII
@ 2026-03-13 14:21 Charles Perry
2026-03-14 2:06 ` Jakub Kicinski
2026-03-17 3:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 5+ messages in thread
From: Charles Perry @ 2026-03-13 14:21 UTC (permalink / raw)
To: netdev
Cc: Charles Perry, Conor Dooley, Russell King (Oracle), Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, linux-kernel
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 e276e5e40e92 ("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
1338cfef1ff1 ("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: 1338cfef1ff1 ("net: macb: fix SGMII with inband aneg disabled")
Reported-by: Conor Dooley <conor.dooley@microchip.com>
Closes: https://lore.kernel.org/r/20260304-nebulizer-rounding-40fbc81a2ba1@spud
Signed-off-by: Charles Perry <charles.perry@microchip.com>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
Notes:
Changes in v2:
- Add a missing Reported-by: and fix the Tested-by: tag (Conor)
drivers/net/ethernet/cadence/macb_main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 963a5d4e1a88..d1fc6a9b9fe5 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -838,6 +838,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 |
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: macb: set default_an_inband to true for SGMII
2026-03-13 14:21 [PATCH net-next v2] net: macb: set default_an_inband to true for SGMII Charles Perry
@ 2026-03-14 2:06 ` Jakub Kicinski
2026-03-14 9:06 ` Russell King (Oracle)
2026-03-17 3:20 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2026-03-14 2:06 UTC (permalink / raw)
To: Charles Perry
Cc: netdev, Conor Dooley, Russell King (Oracle), Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Russell King, linux-kernel
On Fri, 13 Mar 2026 07:21:39 -0700 Charles Perry wrote:
> 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 e276e5e40e92 ("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
> 1338cfef1ff1 ("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.
I'm assuming this needs a respin now to account for the erronously
merged patch?
--
pw-bot: cr
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: macb: set default_an_inband to true for SGMII
2026-03-14 2:06 ` Jakub Kicinski
@ 2026-03-14 9:06 ` Russell King (Oracle)
2026-03-14 16:08 ` Jakub Kicinski
0 siblings, 1 reply; 5+ messages in thread
From: Russell King (Oracle) @ 2026-03-14 9:06 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Charles Perry, netdev, Conor Dooley, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, linux-kernel
On Fri, Mar 13, 2026 at 07:06:31PM -0700, Jakub Kicinski wrote:
> On Fri, 13 Mar 2026 07:21:39 -0700 Charles Perry wrote:
> > 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 e276e5e40e92 ("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
> > 1338cfef1ff1 ("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.
>
> I'm assuming this needs a respin now to account for the erronously
> merged patch?
It can be merged as well as the vitesse patch.
The problem with the vitesse patch is it _would_ break for MACs that
use phylink and always enable SGMII inband against phylink's
instruction as the vitesse PHY comes up with SGMII inband enabled.
Do we know of any MACs that are like that... well yes. There's at
least one, the thorn of a driver, the poor implementation, known as
stmmac. However, that wasn't the only one - the patch which caused
this regression shows that macb also ignored phylink's wishes.
Are there others? We don't know. This makes the vitesse patch
potentially unsafe and potentially being reverted if problems are
found during 7.1-rc.
So, I think having both patches in gives to best approach for now -
at least if the vitesse patch gets reverted, macb won't regress.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: macb: set default_an_inband to true for SGMII
2026-03-14 9:06 ` Russell King (Oracle)
@ 2026-03-14 16:08 ` Jakub Kicinski
0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2026-03-14 16:08 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Charles Perry, netdev, Conor Dooley, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, linux-kernel
On Sat, 14 Mar 2026 09:06:08 +0000 Russell King (Oracle) wrote:
> > I'm assuming this needs a respin now to account for the erronously
> > merged patch?
>
> It can be merged as well as the vitesse patch.
>
> The problem with the vitesse patch is it _would_ break for MACs that
> use phylink and always enable SGMII inband against phylink's
> instruction as the vitesse PHY comes up with SGMII inband enabled.
> Do we know of any MACs that are like that... well yes. There's at
> least one, the thorn of a driver, the poor implementation, known as
> stmmac. However, that wasn't the only one - the patch which caused
> this regression shows that macb also ignored phylink's wishes.
>
> Are there others? We don't know. This makes the vitesse patch
> potentially unsafe and potentially being reverted if problems are
> found during 7.1-rc.
>
> So, I think having both patches in gives to best approach for now -
> at least if the vitesse patch gets reverted, macb won't regress.
SG, thanks for explaining! I'll apply this after the weekend.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: macb: set default_an_inband to true for SGMII
2026-03-13 14:21 [PATCH net-next v2] net: macb: set default_an_inband to true for SGMII Charles Perry
2026-03-14 2:06 ` Jakub Kicinski
@ 2026-03-17 3:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-17 3:20 UTC (permalink / raw)
To: Charles Perry
Cc: netdev, conor.dooley, rmk+kernel, nicolas.ferre, claudiu.beznea,
andrew+netdev, davem, edumazet, kuba, pabeni, linux, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 13 Mar 2026 07:21:39 -0700 you wrote:
> 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 e276e5e40e92 ("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
> 1338cfef1ff1 ("net: macb: fix SGMII with inband aneg disabled") which
> will turn off in-band autoneg for non hot pluggable PHYs.
>
> [...]
Here is the summary with links:
- [net-next,v2] net: macb: set default_an_inband to true for SGMII
https://git.kernel.org/netdev/net-next/c/348baefbb635
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-17 3:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13 14:21 [PATCH net-next v2] net: macb: set default_an_inband to true for SGMII Charles Perry
2026-03-14 2:06 ` Jakub Kicinski
2026-03-14 9:06 ` Russell King (Oracle)
2026-03-14 16:08 ` Jakub Kicinski
2026-03-17 3:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox