[PATCH net-next v1 4/4] net: phy: Always read EEE LPA in genphy_c45_ethtool_get_eee()
From: Oleksij Rempel
Date: Thu Apr 24 2025 - 09:03:02 EST
Previously, genphy_c45_ethtool_get_eee() used genphy_c45_eee_is_active(),
which skips reading the EEE LPA register if local EEE is disabled. This
prevents ethtool from reporting the link partner's EEE capabilities in
that case.
Replace it with genphy_c45_read_eee_lpa(), which always reads the LPA
register regardless of local EEE state. This allows users to see the
link partner's EEE advertisement even when EEE is disabled locally.
Example before the patch:
EEE settings for lan1:
EEE status: disabled
Tx LPI: disabled
Supported EEE link modes: 100baseT/Full
1000baseT/Full
Advertised EEE link modes: Not reported
Link partner advertised EEE link modes: Not reported
After the patch:
EEE settings for lan1:
EEE status: disabled
Tx LPI: disabled
Supported EEE link modes: 100baseT/Full
1000baseT/Full
Advertised EEE link modes: Not reported
Link partner advertised EEE link modes: 100baseT/Full
1000baseT/Full
Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
drivers/net/phy/phy-c45.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 8eb12433387d..9c582abc023a 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -1510,8 +1510,8 @@ int genphy_c45_ethtool_get_eee(struct phy_device *phydev,
{
int ret;
- ret = genphy_c45_eee_is_active(phydev, data->lp_advertised);
- if (ret < 0)
+ ret = genphy_c45_read_eee_lpa(phydev, data->lp_advertised);
+ if (ret)
return ret;
data->eee_active = phydev->eee_active;
--
2.39.5