[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250424130222.3959457-4-o.rempel@pengutronix.de>
Date: Thu, 24 Apr 2025 15:02:21 +0200
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Woojung Huh <woojung.huh@...rochip.com>,
Andrew Lunn <andrew@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>,
kernel@...gutronix.de,
linux-kernel@...r.kernel.org,
netdev@...r.kernel.org,
UNGLinuxDriver@...rochip.com,
Simon Horman <horms@...nel.org>,
Maxime Chevallier <maxime.chevallier@...tlin.com>
Subject: [PATCH net-next v1 3/4] net: phy: Don't report advertised EEE modes if EEE is disabled
Currently, `ethtool --show-eee` reports "Advertised EEE link modes" even when
EEE is disabled, which can be misleading. For example:
EEE settings for lan1:
EEE status: disabled
Tx LPI: disabled
Supported EEE link modes: 100baseT/Full
1000baseT/Full
Advertised EEE link modes: 100baseT/Full
1000baseT/Full
Link partner advertised EEE link modes: Not reported
This may lead to confusion for users who aren't familiar with kernel internals
but understand that EEE functionality depends on proper advertisement during
link negotiation. Seeing advertised EEE modes in this case might incorrectly
suggest that EEE is still being advertised.
After this change, if EEE is disabled, the output becomes:
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
This better reflects the actual EEE configuration. The fix ensures
advertised EEE modes are only reported when eee_cfg.eee_enabled is true.
Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
---
drivers/net/phy/phy-c45.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index bdd70d424491..8eb12433387d 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -1517,7 +1517,8 @@ int genphy_c45_ethtool_get_eee(struct phy_device *phydev,
data->eee_active = phydev->eee_active;
linkmode_andnot(data->supported, phydev->supported_eee,
phydev->eee_disabled_modes);
- linkmode_copy(data->advertised, phydev->advertising_eee);
+ if (phydev->eee_cfg.eee_enabled)
+ linkmode_copy(data->advertised, phydev->advertising_eee);
return 0;
}
EXPORT_SYMBOL(genphy_c45_ethtool_get_eee);
--
2.39.5
Powered by blists - more mailing lists