Netdev List
 help / color / mirror / Atom feed
From: James Hilliard <james.hilliard1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	 Russell King <linux@armlinux.org.uk>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 James Hilliard <james.hilliard1@gmail.com>
Subject: [PATCH v2 0/2] net: phy: add PHY-autonomous EEE provider support
Date: Mon, 03 Aug 2026 15:54:02 -0600	[thread overview]
Message-ID: <20260803-phy-autonomous-eee-v1-v2-0-222a187ba2bb@gmail.com> (raw)

Some PHYs implement a vendor-specific autonomous EEE mode. Once EEE is
negotiated, the PHY can generate transmit Low Power Idle (LPI) without
MAC assistance. Linux must select exactly one LPI provider: enabling both
the MAC and PHY paths conflicts, while enabling neither makes a successful
ethtool request ineffective.

Earlier autonomous-EEE design discussions established that:

  - provider control belongs in phylib first, so non-phylink drivers can
    use it too;
  - PHY drivers should receive a narrow autonomous-EEE operation rather
    than the complete ethtool structure;
  - phylib must remember whether the MAC or PHY provides Tx LPI, because
    enable_tx_lpi must ask the MAC only when the MAC was selected; and
  - userspace should continue to see one EEE interface. Provider choice is
    an implementation detail, not a new ethtool mode.

Patch 1 implements that phylib model. It adds explicit legacy, MAC and
PHY provider states, a set_autonomous_eee() driver operation taking the
enable state and idle timer, and phylib calls which select either provider.
It routes ethtool Tx LPI changes to the selected PHY with rollback, keeps
enable_tx_lpi clear for the PHY provider, and restores the selected mode
after a PHY reset.

Patch 2 makes phylink select the MAC when its LPI implementation is
usable for the attached interface, otherwise fall back to a configurable
autonomous PHY. A PHY which changes interface with speed uses the MAC only
when all its possible interfaces support MAC LPI, keeping the provider
stable across link transitions. EEE remains unavailable when neither path
can provide it.

Previous discussions and review:

  https://lore.kernel.org/netdev/d86c53213a6328b701b8aabbde5d1c83@tipi-net.de/
  https://lore.kernel.org/netdev/20260406-devel-autonomous-eee-v1-0-b335e7143711@tipi-net.de/
  https://lore.kernel.org/netdev/ad954550-9dec-4e0d-8636-0b6cb379421e@lunn.ch/

Changes v1 -> v2:
  - split the generic EEE work into this standalone series
  - replace callback-presence inference with explicit provider state
  - replace the full eee_config callback argument with enable and timer
  - add the phylib provider API before integrating it with phylink
  - handle interface-specific MAC support without changing providers when a
    PHY switches interface with link speed

Tested with x86_64 and arm64 defconfig builds of phy.o, phy_device.o
and phylink.o. Runtime-tested on an Allwinner H616 system with an
X-Powers AC300 PHY using the autonomous PHY provider path. Testing
covered EEE enable and disable, Tx LPI timer validation and rollback,
restoration across a control-provider power cycle, and link traffic
with EEE active. The generated patches pass checkpatch.pl --strict.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
James Hilliard (2):
      net: phy: support PHY-autonomous EEE as an LPI provider
      net: phylink: use PHY-autonomous EEE when MAC LPI is unavailable

 drivers/net/phy/phy.c        |  48 ++++++++++++++++--
 drivers/net/phy/phy_device.c | 118 +++++++++++++++++++++++++++++++++++++------
 drivers/net/phy/phylink.c    |  89 ++++++++++++++++++++++++++++----
 include/linux/phy.h          |  41 +++++++++++++--
 4 files changed, 262 insertions(+), 34 deletions(-)
---
base-commit: 848acc8ffe1b7cd5f1bf427b93069becfebc2c9d
change-id: 20260803-phy-autonomous-eee-v1-38ed922f20c9

Best regards,
--  
James Hilliard <james.hilliard1@gmail.com>


             reply	other threads:[~2026-08-03 21:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 21:54 James Hilliard [this message]
2026-08-03 21:54 ` [PATCH v2 1/2] net: phy: support PHY-autonomous EEE as an LPI provider James Hilliard
2026-08-03 21:54 ` [PATCH v2 2/2] net: phylink: use PHY-autonomous EEE when MAC LPI is unavailable James Hilliard
2026-08-03 22:08 ` [PATCH v2 0/2] net: phy: add PHY-autonomous EEE provider support 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=20260803-phy-autonomous-eee-v1-v2-0-222a187ba2bb@gmail.com \
    --to=james.hilliard1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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