[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241114081653.3939346-2-yong.liang.choong@linux.intel.com>
Date: Thu, 14 Nov 2024 16:16:52 +0800
From: Choong Yong Liang <yong.liang.choong@...ux.intel.com>
To: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Oleksij Rempel <o.rempel@...gutronix.de>
Cc: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH net v1 1/2] net: phy: set eee_cfg based on PHY configuration
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@...r.kernel.org>
Signed-off-by: Choong Yong Liang <yong.liang.choong@...ux.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
Powered by blists - more mailing lists