From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Nicolai Buchwitz <nb@tipi-net.de>, netdev@vger.kernel.org
Subject: Re: RFC: phylink: disable PHY autonomous EEE when MAC manages LPI
Date: Wed, 1 Apr 2026 16:05:32 +0100 [thread overview]
Message-ID: <ac00PIpzXPjxktzC@shell.armlinux.org.uk> (raw)
In-Reply-To: <48abd3e3-a3ee-4e85-a3d8-20c8ceedfb77@lunn.ch>
On Wed, Apr 01, 2026 at 03:11:24PM +0200, Andrew Lunn wrote:
> > Thanks Russell and Andrew. You're both heading in the same direction,
> > so to make sure I understand correctly:
> >
> > 1. Add a new phylib interface (separate from phy_ethtool_set_eee) to
> > control PHY-autonomous EEE, e.g. phy_set_autonomous_eee(phydev,
> > enable) and phy_get_autonomous_eee(phydev) to query the current
> > state.
>
> In the end, we want the MAC driver using phylib to just call the
> phylib methods for configuring EEE, and the MAC driver should not care
> if EEE is actually implemented in the PHY or the MAC. The adjust_link
> callback would simply not enable LPI if the PHY is doing EEE.
This won't work.
If we mask out eee.tx_lpi_enabled when calling into phylib to tell
phylib drivers to disable SmartEEE (that's what I'm calling it here
because it's easier to type)), then phylib records that tx_lpi_enabled
was false. This then makes the following in phy_check_link_status():
phydev->enable_tx_lpi = phydev->eee_cfg.tx_lpi_enabled &&
phydev->eee_active;
set phydev->enable_tx_lpi to false, which in turn tells the MAC
driver or phylink not to enable LPI. So, we lose the ability to use EEE
- a regression - because we're overloading tx_lpi_enabled to mean
"disable SmartEEE" at the PHY.
To work around this, we'd need to go back to the old days of EEE and
have each and every MAC driver resolve the EEE state themselves
because phylib's resolution will now always teoo the MAC driver to
disable LPI.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2026-04-01 15:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 21:27 RFC: phylink: disable PHY autonomous EEE when MAC manages LPI Nicolai Buchwitz
2026-03-31 22:56 ` Andrew Lunn
2026-04-01 7:43 ` Russell King (Oracle)
2026-04-01 12:12 ` Nicolai Buchwitz
2026-04-01 12:48 ` Russell King (Oracle)
2026-04-01 13:11 ` Andrew Lunn
2026-04-01 15:05 ` Russell King (Oracle) [this message]
2026-04-01 15:38 ` Andrew Lunn
2026-04-01 16:02 ` Russell King (Oracle)
2026-04-02 7:53 ` Nicolai Buchwitz
2026-04-02 12:32 ` Russell King (Oracle)
2026-04-02 13:32 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac00PIpzXPjxktzC@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox