From 9f2b8a35f14e8d91edfaf3e77fdfb5a1f099f191 Mon Sep 17 00:00:00 2001 From: Julius Bairaktaris Date: Fri, 9 Oct 2026 20:41:30 +0200 Subject: [PATCH] qualcommax: qca_ppe: fix EEE on the 2.5G and 10G ports phylink sets the PHY EEE advertisement from lpi_capabilities and does not check lpi_interfaces, so the PHY of a USXGMII or 10GBASE-R port advertises EEE although the MAC never enables LPI there. The XPCS behind those modes reports no EEE ability (SR_XS_PCS_EEE_ABL reads 0 on IPQ8074), and qca-ssdk does not enable MAC EEE on them for that reason. Offer EEE only on a port whose phy-mode has MAC LPI, and add 2500BASE-X at 2.5 Gbit/s on ports 5 and 6, which qca-ssdk treats as EEE capable. Fixes: dd052b4594a6 ("qualcommax: qca_ppe: add EEE support") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Julius Bairaktaris Link: https://github.com/openwrt/openwrt/pull/25754 Signed-off-by: Robert Marko --- .../net/ethernet/qualcomm/qca_ppe_main.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/target/linux/qualcommax/files/drivers/net/ethernet/qualcomm/qca_ppe_main.c b/target/linux/qualcommax/files/drivers/net/ethernet/qualcomm/qca_ppe_main.c index e57dd6896c7..157f0f732c4 100644 --- a/target/linux/qualcommax/files/drivers/net/ethernet/qualcomm/qca_ppe_main.c +++ b/target/linux/qualcommax/files/drivers/net/ethernet/qualcomm/qca_ppe_main.c @@ -916,6 +916,7 @@ static void qca_ppe_phylink_get_caps(struct dsa_switch *ds, int port, struct phylink_config *config) { struct dsa_port *dp = dsa_to_port(ds, port); + phy_interface_t mode; if (port != 0) { config->num_possible_pcs = fwnode_phylink_pcs_count(of_fwnode_handle(dp->dn)); @@ -968,10 +969,25 @@ static void qca_ppe_phylink_get_caps(struct dsa_switch *ds, int port, config->supported_interfaces); if (port != 0) { - config->lpi_capabilities = MAC_100FD | MAC_1000FD; __set_bit(PHY_INTERFACE_MODE_QSGMII, config->lpi_interfaces); __set_bit(PHY_INTERFACE_MODE_PSGMII, config->lpi_interfaces); __set_bit(PHY_INTERFACE_MODE_SGMII, config->lpi_interfaces); + if (port >= 5) + __set_bit(PHY_INTERFACE_MODE_2500BASEX, + config->lpi_interfaces); + + /* phylink sets the PHY EEE advertisement from lpi_capabilities + * alone, and the XPCS behind USXGMII and 10GBASE-R reports no + * EEE ability, so EEE is offered only on a port whose phy-mode + * has MAC LPI. + */ + if (of_get_phy_mode(dp->dn, &mode) || + !test_bit(mode, config->lpi_interfaces)) + return; + + config->lpi_capabilities = MAC_100FD | MAC_1000FD; + if (port >= 5) + config->lpi_capabilities |= MAC_2500FD; config->lpi_timer_default = 256; config->eee_enabled_default = true; }