Re: [PATCH net v1 1/1] net: phylink: keep initial advertising settings

From: Andrew Lunn

Date: Fri Nov 06 2026 - 08:56:41 EST


On Wed, Nov 04, 2026 at 01:55:09PM +0100, Thilo Zirnstein wrote:
> If the net device is phylink based,
> consists of a mac with a phy connected and the
> mac driver does add the phy while the ndo_open callback,
> initial advertising settings of the link may be overwritten
> during phylink_bringup_phy.
>
> The mode of action is as follows:
>
> * The link was not up yet - no phy connected
> * the user configures the advertisement of the interface
> * the mac driver delegates the call to phylink_ethtool_ksettings_set
> * here we are not configuring the phy - it does not exist yet

If it does not exist, it is not possible to validate the user request
is actually supported by the PHY.

> * the user set up the interface
> * the mac drivers calls phylink_connect_phy

At this point, is the previously configured value sanitised by what
the PHY can actually do?

Take the example of a MAC which can do up to 2500BaseX, but it is
connected to a PHY which only supports SGMII. Before up, the user
could request 2.5GBaseT, but at admin up that needs to be reduced down
to 1G.

Andrew