Messages in this thread | | | Date | Mon, 6 Feb 2023 16:39:52 +0100 | From | Andrew Lunn <> | Subject | Re: [PATCH net-next v4 00/23] net: add EEE support for KSZ9477 and AR8035 with i.MX6 |
| |
> > > What is the code flow through the kernel with EEE? I wasn't able to find > > > a good explanation about it. > > > > > > Is it advertised by default, if supported? I guess phy_advertise_supported() > > > does that.
The old flow is poorly defined. If the MAC supports EEE, it should call phy_init_eee(). That looks at the results of auto-neg and returns if EEE has been negotiated or not.
However, i'm not aware of any code which disables by default the advertisement of EEE, or actually enables the negotiation of EEE. So there are probably a number of PHYs which are EEE capable, connected to a MAC driver which does not call phy_init_eee() and are advertising EEE and negotiating EEE. There might also be a subset of that which are actually doing EEE, despite not calling phy_init_eee().
So the current code is not good, and there is a danger we introduce power regressions as we sort this out.
The current MAC/PHY API is pretty broken. We probably should be handling this similar to pause. A MAC which supports pause should call phy_support_asym_pause() or phy_support_sym_pause() which will cause the PHY to advertise its supported Pause modes. So we might want to add a phy_support_eee()? We then want the result of EEE negotiation available in phydev for when the link_adjust() callback is called.
A quick look at a few MAC drivers seems to indicate many are getting it wrong and don't actually wait for the result of the auto-neg....
Andrew
| |