mbox series

[net-next,v9,0/7] net: ethernet: Rework EEE

Message ID 20240302195306.3207716-1-o.rempel@pengutronix.de (mailing list archive)
Headers show
Series net: ethernet: Rework EEE | expand

Message

Oleksij Rempel March 2, 2024, 7:52 p.m. UTC
Hello all,

with Andrew's permission I'll continue mainlining this patches:

==============================================================

Most MAC drivers get EEE wrong. The API to the PHY is not very
obvious, which is probably why. Rework the API, pushing most of the
EEE handling into phylib core, leaving the MAC drivers to just
enable/disable support for EEE in there change_link call back.

MAC drivers are now expect to indicate to phylib if they support
EEE. This will allow future patches to configure the PHY to advertise
no EEE link modes when EEE is not supported. The information could
also be used to enable SmartEEE if the PHY supports it.

With these changes, the uAPI configuration eee_enable becomes a global
on/off. tx-lpi must also be enabled before EEE is enabled. This fits
the discussion here:

https://lore.kernel.org/netdev/af880ce8-a7b8-138e-1ab9-8c89e662eecf@gmail.com/T/

This patchset puts in place all the infrastructure, and converts one
MAC driver to the new API. Following patchsets will convert other MAC
drivers, extend support into phylink, and when all MAC drivers are
converted to the new scheme, clean up some unneeded code.

v9:
--
change dst<>src order for eeecfg_to_eee() and eee_to_eeecfg()
drop phy_eee_clk_stop_enable() patch

v8:
--
update phydev->link value before phy_link_down/up cycle

v7:
--
add phy_link_down() before phy_link_up()
rewrite comment for phy_ethtool_set_eee_noneg()
add check for changed tx_lpi_timer

v6:
--
Reword different comments. See per patch change comments.

v5:
--
Rebase against latest netdev-next
Use keee instead of eee struct

v4
--
Only convert one MAC driver
Drop all phylink code
Conform to the uAPI discision.

v3
--
Rework phylink code to add a new callback.
Rework function to indicate clock should be stopped during LPI

Andrew Lunn (6):
  net: phy: Add phydev->enable_tx_lpi to simplify adjust link callbacks
  net: phy: Keep track of EEE configuration
  net: phy: Immediately call adjust_link if only tx_lpi_enabled changes
  net: phy: Add phy_support_eee() indicating MAC support EEE
  net: fec: Move fec_enet_eee_mode_set() and helper earlier
  net: fec: Fixup EEE

Russell King (1):
  net: add helpers for EEE configuration

 drivers/net/ethernet/freescale/fec_main.c | 84 ++++++++++-------------
 drivers/net/phy/phy-c45.c                 | 14 +++-
 drivers/net/phy/phy.c                     | 50 +++++++++++++-
 drivers/net/phy/phy_device.c              | 28 ++++++++
 include/linux/phy.h                       |  8 ++-
 include/net/eee.h                         | 38 ++++++++++
 6 files changed, 168 insertions(+), 54 deletions(-)
 create mode 100644 include/net/eee.h

Comments

patchwork-bot+netdevbpf@kernel.org March 6, 2024, 3:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat,  2 Mar 2024 20:52:59 +0100 you wrote:
> Hello all,
> 
> with Andrew's permission I'll continue mainlining this patches:
> 
> ==============================================================
> 
> Most MAC drivers get EEE wrong. The API to the PHY is not very
> obvious, which is probably why. Rework the API, pushing most of the
> EEE handling into phylib core, leaving the MAC drivers to just
> enable/disable support for EEE in there change_link call back.
> 
> [...]

Here is the summary with links:
  - [net-next,v9,1/7] net: add helpers for EEE configuration
    https://git.kernel.org/netdev/net-next/c/6f2fc8584a46
  - [net-next,v9,2/7] net: phy: Add phydev->enable_tx_lpi to simplify adjust link callbacks
    https://git.kernel.org/netdev/net-next/c/e3b6876ab850
  - [net-next,v9,3/7] net: phy: Keep track of EEE configuration
    https://git.kernel.org/netdev/net-next/c/fe0d4fd9285e
  - [net-next,v9,4/7] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes
    https://git.kernel.org/netdev/net-next/c/3e43b903da04
  - [net-next,v9,5/7] net: phy: Add phy_support_eee() indicating MAC support EEE
    https://git.kernel.org/netdev/net-next/c/49168d1980e2
  - [net-next,v9,6/7] net: fec: Move fec_enet_eee_mode_set() and helper earlier
    https://git.kernel.org/netdev/net-next/c/aff1b8c84b44
  - [net-next,v9,7/7] net: fec: Fixup EEE
    https://git.kernel.org/netdev/net-next/c/6a2495adc0c8

You are awesome, thank you!