Subject: Re: [PATCH net-next v4 4/4] phy: aquantia: Determine rate adaptation support from registers

From: "Russell King (Oracle)" <[email-masked]>
Date: Fri, 16 Dec 2022 17:01:38 +0000

On Fri, Dec 16, 2022 at 11:48:51AM -0500, Sean Anderson wrote:
> When autonegotiation completes, the phy interface will be set based on
> the global config register for that speed. If the SERDES mode is set to
> something which the MAC does not support, then the link will not come
> up. To avoid this, validate each combination of interface speed and link
> speed which might be configured. This way, we ensure that we only
> consider rate adaptation in our advertisement when we can actually use
> it.
> 
> The API for get_rate_matching requires that PHY_INTERFACE_MODE_NA be
> handled properly.

This is no longer true. phy_get_rate_matching() used to be called with
PHY_INTERFACE_MODE_NA in phylink_bringup_phy(), but that no longer
happens as we need to know whether rate matching will be used to avoid
breaking stuff. See commit 7642cc28fd37 ("net: phylink: fix PHY
validation with rate adaption").

The purpose of PHY_INTERFACE_MODE_NA in phylink_bringup_phy() was to
deal with PHYs which switch their MAC-facing interface mode, but we
know that if a PHY uses rate adaption, the assumption now is that it
won't switch its MAC-facing interface, which fixes a problem that
Tim Harvey was having with the rate adaption code - and I believe
you agreed with.

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