Re: [PATCH net-next v6 1/7] net: phylink: use act_link_an_mode to determine PHY
From: Russell King (Oracle)
Date: Tue Feb 04 2025 - 07:08:42 EST
On Tue, Feb 04, 2025 at 02:10:14PM +0800, Choong Yong Liang wrote:
> When the interface mode is SGMII and act_link_an_mode is MLO_AN_INBAND,
> switching to the 2500BASE-X interface mode will trigger
> phylink_major_config, and act_link_an_mode will be updated to MLO_AN_PHY
> in phylink_pcs_neg_mode when the PCS does not support in-band mode.
> The MAC and PCS will configure according to the interface mode
> and act_link_an_mode.
act_link_an_mode must only ever be updated by phylink_major_config()
since it defines state for the currently configured mode, and must
stay in sync with how the hardware has been programmed at all times.
> However, when the interface goes link down and then link up again, the MAC
> will attempt to attach the PHY.
Why is the MAC trying to disconnect and reconnect the PHY on link
changes? Do you really mean "link down" and "link up" as in "connection
with the link partner" or do you mean administratively taking the
interface down and up (which is a completely different thing.)
> The interface mode remains as 2500BASE-X,
> but cfg_link_an_mode still holds MLO_AN_INBAND. This causes a failure to
> attach the PHY.
Hmm.
pl->link_interface is the configured setting from firmware etc and doesn't
change.
pl->cfg_link_an_mode is the configured mode from firmware etc which was
passed to phylink_create(), and again doesn't change.
So there should be no difference unless something weird is going on,
which as you're talking about stmmac, could be the case.
More information needed, but as this patch currently stands, I deem it
to be incorrect, sorry.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!