Re: [PATCH net-next] net: renesas: rswitch: cleanup max_speed setting

From: Andrew Lunn
Date: Wed Feb 05 2025 - 14:28:13 EST


On Wed, Feb 05, 2025 at 05:26:09PM +0100, Nikita Yushchenko wrote:
> > You should only need max-speed when you have a PHY which can do more
> > than the MAC.
>
> This is exactly the case.

O.K. Please expand the commit message to explain this.

> Unfortunately I don't have the spider schematics nearby, but AFAIU (one of
> flavours of) the board has PHYs capable of 5G but connected over SGMII.
> When two such boards are connected to each other, on mainline kernel
> auto-negotiation takes noticeably longer than with the Renesas BSP kernel.

I'm actually curious how it established a link at all. If both PHYs
are advertising 5G, they should be happy on the media side. They will
get link. But they will ask the MAC to swap to 5000BaseX or similar. I
assume the MAC cannot do that, but what does it do? How does the PHY
know it should try something slower?

> > Also, phylink handles this a lot better than phylib. So you might want
> > to change rswitch to phylink, especially if you have link speeds > 1G.
>
> The reverse switch happened in commit c16a5033f77b ("net: renesas: rswitch: Convert to phy_device").
> I did not check the tech details of that, but decided not to touch it.

Might be worth taking another look, especially if anybody wants to use
SFPs.

Andrew