Skip to content

Commit 17f47da

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: split hardware LPI timer control
Provide stmmac_disable_hw_lpi_timer() and stmmac_enable_hw_lpi_timer() to control the hardware transmit LPI timer. Reviewed-by: Andrew Lunn <[email protected]> Tested-by: Choong Yong Liang <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 27af081 commit 17f47da

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,24 @@ static inline u32 stmmac_rx_dirty(struct stmmac_priv *priv, u32 queue)
390390
return dirty;
391391
}
392392

393-
static void stmmac_lpi_entry_timer_config(struct stmmac_priv *priv, bool en)
393+
static void stmmac_disable_hw_lpi_timer(struct stmmac_priv *priv)
394+
{
395+
stmmac_set_eee_lpi_timer(priv, priv->hw, 0);
396+
}
397+
398+
static void stmmac_enable_hw_lpi_timer(struct stmmac_priv *priv)
394399
{
395-
u32 tx_lpi_timer;
400+
stmmac_set_eee_lpi_timer(priv, priv->hw, priv->tx_lpi_timer);
401+
}
396402

403+
static void stmmac_lpi_entry_timer_config(struct stmmac_priv *priv, bool en)
404+
{
397405
/* Clear/set the SW EEE timer flag based on LPI ET enablement */
398406
priv->eee_sw_timer_en = en ? 0 : 1;
399-
tx_lpi_timer = en ? priv->tx_lpi_timer : 0;
400-
stmmac_set_eee_lpi_timer(priv, priv->hw, tx_lpi_timer);
407+
if (en)
408+
stmmac_enable_hw_lpi_timer(priv);
409+
else
410+
stmmac_disable_hw_lpi_timer(priv);
401411
}
402412

403413
/**

0 commit comments

Comments
 (0)