diff mbox series

[net,v1,2/2] net: stmmac: update eee_cfg after mac link up/down

Message ID 20241112072447.3238892-3-yong.liang.choong@linux.intel.com (mailing list archive)
State New
Headers show
Series Fix ethtool --show-eee for stmmac | expand

Commit Message

Choong Yong Liang Nov. 12, 2024, 7:24 a.m. UTC
Update the eee_cfg values during link-up/down to ensure that
'ethtool --show-eee <devname>' works correctly.

Fixes: fe0d4fd9285e ("net: phy: Keep track of EEE configuration")
Cc: <stable@vger.kernel.org>
Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 7bf275f127c9..1e16c2d8f951 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1005,6 +1005,8 @@  static void stmmac_mac_link_down(struct phylink_config *config,
 	priv->tx_lpi_enabled = false;
 	priv->eee_enabled = stmmac_eee_init(priv);
 	stmmac_set_eee_pls(priv, priv->hw, false);
+	phy_update_eee(priv->dev->phydev, priv->tx_lpi_enabled, priv->eee_enabled,
+		       priv->tx_lpi_timer);
 
 	if (priv->dma_cap.fpesel)
 		stmmac_fpe_link_state_handle(priv, false);
@@ -1118,6 +1120,8 @@  static void stmmac_mac_link_up(struct phylink_config *config,
 		priv->eee_enabled = stmmac_eee_init(priv);
 		priv->tx_lpi_enabled = priv->eee_enabled;
 		stmmac_set_eee_pls(priv, priv->hw, true);
+		phy_update_eee(phy, priv->tx_lpi_enabled, priv->eee_enabled,
+			       priv->tx_lpi_timer);
 	}
 
 	if (priv->dma_cap.fpesel)