[PATCH net v1 1/2] net: phy: set eee_cfg based on PHY configuration
Choong Yong Liang
yong.liang.choong at linux.intel.com
Thu Nov 14 00:16:52 PST 2024
Not all PHYs have EEE enabled by default. For example, Marvell PHYs are
designed to have EEE hardware disabled during the initial state, and it
needs to be configured to turn it on again.
This patch reads the PHY configuration and sets it as the initial value for
eee_cfg.tx_lpi_enabled and eee_cfg.eee_enabled instead of having them set to
true by default.
Fixes: 49168d1980e2 ("net: phy: Add phy_support_eee() indicating MAC support EEE")
Cc: <stable at vger.kernel.org>
Signed-off-by: Choong Yong Liang <yong.liang.choong at linux.intel.com>
---
drivers/net/phy/phy_device.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 499797646580..b4fa40c2371a 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3010,9 +3010,12 @@ EXPORT_SYMBOL_GPL(phy_advertise_eee_all);
*/
void phy_support_eee(struct phy_device *phydev)
{
+ bool is_enabled = true;
+
+ genphy_c45_eee_is_active(phydev, NULL, NULL, &is_enabled);
linkmode_copy(phydev->advertising_eee, phydev->supported_eee);
- phydev->eee_cfg.tx_lpi_enabled = true;
- phydev->eee_cfg.eee_enabled = true;
+ phydev->eee_cfg.tx_lpi_enabled = is_enabled;
+ phydev->eee_cfg.eee_enabled = is_enabled;
}
EXPORT_SYMBOL(phy_support_eee);
--
2.34.1
More information about the linux-arm-kernel
mailing list