public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: macb: set default_an_inband to true for SGMII
@ 2026-03-12 13:38 Charles Perry
  2026-03-12 15:01 ` Conor Dooley
  2026-03-12 19:58 ` Russell King (Oracle)
  0 siblings, 2 replies; 4+ messages in thread
From: Charles Perry @ 2026-03-12 13:38 UTC (permalink / raw)
  To: netdev
  Cc: Conor Dooley, Charles Perry, 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")
Closes: https://lore.kernel.org/r/20260304-nebulizer-rounding-40fbc81a2ba1@spud
Tested-by: Conor Dooley <conor@kernel.org>
Signed-off-by: Charles Perry <charles.perry@microchip.com>
---
 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] 4+ messages in thread

* Re: [PATCH net-next] net: macb: set default_an_inband to true for SGMII
  2026-03-12 13:38 [PATCH net-next] net: macb: set default_an_inband to true for SGMII Charles Perry
@ 2026-03-12 15:01 ` Conor Dooley
  2026-03-12 17:49   ` Charles Perry
  2026-03-12 19:58 ` Russell King (Oracle)
  1 sibling, 1 reply; 4+ messages in thread
From: Conor Dooley @ 2026-03-12 15:01 UTC (permalink / raw)
  To: Charles Perry
  Cc: netdev, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Russell King, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2598 bytes --]

On Thu, Mar 12, 2026 at 06:38:55AM -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.
> 
> Fixes: 1338cfef1ff1 ("net: macb: fix SGMII with inband aneg disabled")
> Closes: https://lore.kernel.org/r/20260304-nebulizer-rounding-40fbc81a2ba1@spud

Reported-by: Conor Dooley <conor.dooley@microchip.com>

> Tested-by: Conor Dooley <conor@kernel.org>

Just as an FYI, you shouldn't insert tags that "certify" the quality of
your patch that you weren't explicitly given. Reported-by/Suggested-by
you can conjure up yourself where appropriate, but Tested-by/Acked-by/Reviewed-by
need more care.

But of course, I did test it, and it restored functionality on both
boards that I have here, so:
Tested-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> Signed-off-by: Charles Perry <charles.perry@microchip.com>
> ---
>  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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: macb: set default_an_inband to true for SGMII
  2026-03-12 15:01 ` Conor Dooley
@ 2026-03-12 17:49   ` Charles Perry
  0 siblings, 0 replies; 4+ messages in thread
From: Charles Perry @ 2026-03-12 17:49 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Charles Perry, netdev, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Russell King, linux-kernel

On Thu, Mar 12, 2026 at 03:01:39PM +0000, Conor Dooley wrote:
> On Thu, Mar 12, 2026 at 06:38:55AM -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.
> > 
> > Fixes: 1338cfef1ff1 ("net: macb: fix SGMII with inband aneg disabled")
> > Closes: https://lore.kernel.org/r/20260304-nebulizer-rounding-40fbc81a2ba1@spud
> 
> Reported-by: Conor Dooley <conor.dooley@microchip.com>
> 
> > Tested-by: Conor Dooley <conor@kernel.org>
> 
> Just as an FYI, you shouldn't insert tags that "certify" the quality of
> your patch that you weren't explicitly given. Reported-by/Suggested-by
> you can conjure up yourself where appropriate, but Tested-by/Acked-by/Reviewed-by
> need more care.
> 

Ok, thank you for pointing this out.

> But of course, I did test it, and it restored functionality on both
> boards that I have here, so:
> Tested-by: Conor Dooley <conor.dooley@microchip.com>
> 

Thanks,
Charles


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: macb: set default_an_inband to true for SGMII
  2026-03-12 13:38 [PATCH net-next] net: macb: set default_an_inband to true for SGMII Charles Perry
  2026-03-12 15:01 ` Conor Dooley
@ 2026-03-12 19:58 ` Russell King (Oracle)
  1 sibling, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2026-03-12 19:58 UTC (permalink / raw)
  To: Charles Perry
  Cc: netdev, Conor Dooley, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-kernel

On Thu, Mar 12, 2026 at 06:38:55AM -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.
> 
> Fixes: 1338cfef1ff1 ("net: macb: fix SGMII with inband aneg disabled")
> Closes: https://lore.kernel.org/r/20260304-nebulizer-rounding-40fbc81a2ba1@spud

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!

-- 
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] 4+ messages in thread

end of thread, other threads:[~2026-03-12 19:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12 13:38 [PATCH net-next] net: macb: set default_an_inband to true for SGMII Charles Perry
2026-03-12 15:01 ` Conor Dooley
2026-03-12 17:49   ` Charles Perry
2026-03-12 19:58 ` Russell King (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox