Re: [PATCH] net: phy: phy_ethtool_ksettings_set: Allow any supported speed

From: Maxime Chevallier
Date: Mon Dec 02 2024 - 04:59:54 EST


Hello Nikita,

On Mon, 2 Dec 2024 14:20:17 +0500
Nikita Yushchenko <nikita.yoush@xxxxxxxxxxxxxxxxxx> wrote:

> Hello.
>
> > What's your use-case to need >1G fixed-settings link ?
>
> My hardware is Renesas VC4 board (based on Renesas S4 SoC), network driver is rswitch, PHY in question
> is Marvell 88Q3344 (2.5G Base-T1).

Ok so it's baseT1, which is indeed different than the BaseT4 case I was
mentionning. It could be good to include that in the commit log :)

> To get two such PHYs talk to each other, one of the two has to be manually configured as slave.
> (e.g. ethtool -s tsn0 master-slave forced-slave).
>
> This gets handled via driver's ethtool set_link_ksettings method, which is currently set to
> phy_ethtool_ksettings_set().
>
> Writing a custom set_link_ksettings method just to not error out when speed is 2500 looks ugly.

Yes and this would apply to any PHY that does >1G BaseT1. The thing is,
while it does solve the problem you're facing, the current proposition
will impact 2.5G/5G/10GBaseT4.

I don't think you need to write a custom set_link_ksettings, however we
should make an exception for BaseT1. Maybe add an extra condition in
phy_ethtool_ksettings_set() to check in the advertising/supported if we
are dealing with a BaseT1 PHY, and if so bypass the check for
10/100/1000 speeds, as it doesn't apply in your case ?

Maybe the PHY maintainers have better ideas though.

Thanks,

Maxime