net: dsa: microchip: let phylink manage PHY EEE configuration on KSZ switches
authorOleksij Rempel <o.rempel@pengutronix.de>
Sun, 4 May 2025 08:14:33 +0000 (10:14 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 13 May 2025 08:23:24 +0000 (10:23 +0200)
commit76ca05e0abe31a4f47a5b5a85041b5a22c03baf8
tree3c9983e936600cccc6e93cc42bcb6bd0219fc010
parent498625a8ab2c8e1c9ab5105744310e8d6952cc01
net: dsa: microchip: let phylink manage PHY EEE configuration on KSZ switches

Phylink expects MAC drivers to provide LPI callbacks to properly manage
Energy Efficient Ethernet (EEE) configuration. On KSZ switches with
integrated PHYs, LPI is internally handled by hardware, while ports
without integrated PHYs have no documented MAC-level LPI support.

Provide dummy mac_disable_tx_lpi() and mac_enable_tx_lpi() callbacks to
satisfy phylink requirements. Also, set default EEE capabilities during
phylink initialization where applicable.

Since phylink can now gracefully handle optional EEE configuration,
remove the need for the MICREL_NO_EEE PHY flag.

This change addresses issues caused by incomplete EEE refactoring
introduced in commit fe0d4fd9285e ("net: phy: Keep track of EEE
configuration"). It is not easily possible to fix all older kernels, but
this patch ensures proper behavior on latest kernels and can be
considered for backporting to stable kernels starting from v6.14.

Fixes: fe0d4fd9285e ("net: phy: Keep track of EEE configuration")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: stable@vger.kernel.org # v6.14+
Link: https://patch.msgid.link/20250504081434.424489-2-o.rempel@pengutronix.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/microchip/ksz_common.c