Re: [PATCH RFC net-next] net: phylink: add quirk for disabling in-band-status for mediatek pcs at 2500base-x

From: Russell King (Oracle)
Date: Tue Jan 02 2024 - 07:37:06 EST


On Tue, Jan 02, 2024 at 08:43:26AM +0100, Eric Woudstra wrote:
> In follow up to: net: pcs: pcs-mtk-lynxi: use 2500Base-X without AN
>
> MediaTek LynxI PCS, 2500Base-X will only work without inband status due to
> hardware limitation.

Yes, we need better support for 2500base-X connected to a PHY.
Currently, we treat both base-X interface modes as _media_ side modes
by looking at the Autoneg bit. However, given that 2500base-X has been
around for ages in vendor-specific forms, we need to do better. The
introduction of the PHYLINK_PCS_NEG_* enum and phylink_pcs_neg_mode()
is a step towards resolving this (as well as ensuring consistency of
implementation so we _can_ start to address it in phylink rather than
having different PCS drivers doing weird stuff.)

I am _not_ of the opinion that we should be dealing with this based on
compatibles or anything like that.

As 6.6 was declared LTS, I think we can now move phylink_pcs_neg_mode()
into phylink.c, and thus think about what we should do with:

+ /* 1000base-X is designed for use media-side for Fibre
+ * connections, and thus the Autoneg bit needs to be
+ * taken into account. We also do this for 2500base-X
+ * as well, but drivers may not support this, so may
+ * need to override this.
+ */
+ if (!phylink_autoneg_inband(mode))
+ neg_mode = PHYLINK_PCS_NEG_OUTBAND;
+ else if (linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
+ advertising))
+ neg_mode = PHYLINK_PCS_NEG_INBAND_ENABLED;
+ else
+ neg_mode = PHYLINK_PCS_NEG_INBAND_DISABLED;
+ break;

Specifically, the linkmode_test_bit() bit. When there is a PHY present,
the link between the PCS and PHY should _not_ depend on Autoneg as that
is indicates what we want for the _media_ side, and in the case of a
PCS-to-PHY link, that is not the media.

The next issue is the one that you refer to, and there's several issues:

1. some implementations of 2500base-X do not support inband
2. some implementations of 2500base-X appear to require inband
(e.g. mvneta, mvpp2)

I have some thoughts on this, but I don't have the time to express them
in email at the moment (too much to get through post-Christmas post-
Covid.)

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!