RFC: phylink: disable PHY autonomous EEE when MAC manages LPI

Nicolai Buchwitz
2026-03-31T21:27:23Z

Hi

Some PHYs (e.g. Broadcom BCM54xx "AutogrEEEn") manage EEE LPI
autonomously without forwarding LPI signaling to the MAC. This works
fine when the MAC doesn't support EEE, but conflicts with MACs that
implement their own LPI control via phylink's mac_enable_tx_lpi /
mac_disable_tx_lpi.

When the MAC has lpi_capabilities set, the PHY should use Native EEE
mode so the MAC can control LPI entry/exit and observe RX LPI
transitions.

I'm thinking of a flag on phy_device (similar to mac_managed_pm) that
phylink sets when the MAC has lpi_capabilities, and that PHY drivers
check in config_init to disable their autonomous EEE mode:

/* set by phylink when MAC manages LPI */
phydev->mac_managed_lpi = true;

/* in bcm54xx_config_init: */
if (phydev->mac_managed_lpi)
bcm_phy_modify_exp(phydev, MII_BUF_CNTL0,
AUTOGREEEN_EN, 0);

This came up while adding EEE support to the Cadence macb driver (used
on Raspberry Pi 5 with a BCM54210PE PHY). The PHY's AutogrEEEn mode
prevented the MAC from tracking LPI state. As a workaround, the
Raspberry Pi tree currently carries a downstream patch that
unconditionally disables AutogrEEEn for all BCM54xx PHYs, since both
genet and macb now support EEE properly. That's obviously not suitable
for upstream where other MACs paired with BCM54xx may not have LPI
support.

Does this seem like a reasonable approach, or is there a better way to
handle PHY autonomous EEE within phylink?

Thanks

Nicolai