Re: [PATCH net-next 03/12] net: pcs: pcs-xpcs: Preserve BMCR_ANENBLE during link up

From: Andrew Lunn

Date: Fri May 01 2026 - 13:11:27 EST


On Fri, May 01, 2026 at 10:54:11AM -0500, Alex Elder wrote:
> From: Daniel Thompson <daniel@xxxxxxxxxxxx>
>
> Currently the XCPS found on Toshiba TC9564 (a.k.a. Qualcomm QPS615)
> is unable to operate at 1000base-X and slower with a PHY connected
> using SGMII/2500base-X (in our case a Qualcomm QCA8081). The link
> negotiates speed correctly but the MAC can't get any packets out.

We need to break this down into its components.

I assume you are saying the PHY negotiates the media speed with the
link partner. That is PHY talking to PHY.

But we also have the PCS talking to the PHY. There can be inband
signalling here, for SGMII and 2500BaseX. But not for over clocked
SGMII, which is how some vendors implement 2500BaseX. SGMII signalling
does not work when overclocked to 2.5G.

> This attracted attention to the ANENABLE bit and we observed that the
> bit is currently set during config and cleared during link up.

Here we are talking about the PCS ANEBNABLE, not the PHY ANEBNABLE. So
this is negotiation between the PCS and the PHY.

> Preserving the bit during link up allows the system to work as expected.

> int ret;
>
> if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED)
> return;

Think about this.

> ret = xpcs_write(xpcs, MDIO_MMD_VEND2, MII_BMCR,
> - mii_bmcr_encode_fixed(speed, duplex));
> + mii_bmcr_encode_fixed(speed, duplex) | an_enable);

And mii_bmcr_encode_fixed().

Andrew