Re: [PATCH net-next v5 6/8] net: phy: Add phy_support_eee() indicating MAC support EEE

From: Russell King (Oracle)
Date: Fri Feb 23 2024 - 06:22:08 EST


On Thu, Feb 22, 2024 at 08:52:25PM -0800, Florian Fainelli wrote:
>
>
> On 2/20/2024 10:21 PM, Oleksij Rempel wrote:
> > From: Andrew Lunn <andrew@xxxxxxx>
> >
> > In order for EEE to operate, both the MAC and the PHY need to support
> > it, similar to how pause works.
>
> Kinda, a number of PHYs have added support for SmartEEE or AutoGrEEEn in
> order to provide some EEE-like power savings with non-EEE capable MACs.
>
> Oleksij did not you have a patch series at some point that introduced a
> smarteee field in the phy_device structure to reflect that? I thought that
> had been accepted, but maybe not.

I have some similar hacks for the Atheros SmartEEE in my tree that I've
never published.

For SmartEEE, we need two things to happen:

1) MAC drivers must not fail set_eee()/get_eee() just because they
themselves do not support EEE.
2) MAC drivers must not attempt to modify the EEE parameters passed
to phylib.

Whether a MAC driver should be configuring the hardware in set_eee()
at all is another question - because in the case of using SmartEEE
the MAC side is irrelevant. So maybe phylib should have a callback to
set the EEE TX LPI parameters? In phylink, my model was to add two
new functions (one to enable and another to disable TX LPI) and the
enable function always gets passed the TX LPI timeout.

If we did the same in phylib, we would eliminate the need for MAC
drivers to conditionalise based on SmartEEE - that could be handled
entirely within phylib.

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