Message ID | 20230217034230.1249661-5-andrew@lunn.ch (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Rework MAC drivers EEE support | expand |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index e4902a7bb61e..23ad855626ee 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1080,8 +1080,9 @@ static void stmmac_mac_link_up(struct phylink_config *config, stmmac_mac_set(priv, priv->ioaddr, true); if (phy && priv->dma_cap.eee) { - priv->eee_active = - phy_init_eee(phy, !priv->plat->rx_clk_runs_in_lpi) >= 0; + priv->eee_active = phy->eee_active; + if (!priv->plat->rx_clk_runs_in_lpi) + phy_eee_clk_stop_enable(phy); priv->eee_enabled = stmmac_eee_init(priv); priv->tx_lpi_enabled = priv->eee_enabled; stmmac_set_eee_pls(priv, priv->hw, true);
Replace this method by looking at the eee_active member of the phydev structure. Additionally, call the phy_eee_clk_stop_enable() if the platform indicates the clock should be stopped while LPI is active. Signed-off-by: Andrew Lunn <andrew@lunn.ch> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)