Skip to content

Commit 1655a22

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: remove stmmac_lpi_entry_timer_config()
Remove stmmac_lpi_entry_timer_config(), setting priv->eee_sw_timer_en at the original call sites, and calling the appropriate stmmac_xxx_hw_lpi_timer() function. No functional change. 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 17f47da commit 1655a22

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -400,16 +400,6 @@ static void stmmac_enable_hw_lpi_timer(struct stmmac_priv *priv)
400400
stmmac_set_eee_lpi_timer(priv, priv->hw, priv->tx_lpi_timer);
401401
}
402402

403-
static void stmmac_lpi_entry_timer_config(struct stmmac_priv *priv, bool en)
404-
{
405-
/* Clear/set the SW EEE timer flag based on LPI ET enablement */
406-
priv->eee_sw_timer_en = en ? 0 : 1;
407-
if (en)
408-
stmmac_enable_hw_lpi_timer(priv);
409-
else
410-
stmmac_disable_hw_lpi_timer(priv);
411-
}
412-
413403
/**
414404
* stmmac_enable_eee_mode - check and enter in LPI mode
415405
* @priv: driver private structure
@@ -489,7 +479,8 @@ static void stmmac_eee_init(struct stmmac_priv *priv, bool active)
489479
if (!priv->eee_active) {
490480
if (priv->eee_enabled) {
491481
netdev_dbg(priv->dev, "disable EEE\n");
492-
stmmac_lpi_entry_timer_config(priv, 0);
482+
priv->eee_sw_timer_en = true;
483+
stmmac_disable_hw_lpi_timer(priv);
493484
del_timer_sync(&priv->eee_ctrl_timer);
494485
stmmac_set_eee_timer(priv, priv->hw, 0,
495486
STMMAC_DEFAULT_TWT_LS);
@@ -513,11 +504,15 @@ static void stmmac_eee_init(struct stmmac_priv *priv, bool active)
513504
}
514505

515506
if (priv->plat->has_gmac4 && priv->tx_lpi_timer <= STMMAC_ET_MAX) {
507+
/* Use hardware LPI mode */
516508
del_timer_sync(&priv->eee_ctrl_timer);
517509
priv->tx_path_in_lpi_mode = false;
518-
stmmac_lpi_entry_timer_config(priv, 1);
510+
priv->eee_sw_timer_en = false;
511+
stmmac_enable_hw_lpi_timer(priv);
519512
} else {
520-
stmmac_lpi_entry_timer_config(priv, 0);
513+
/* Use software LPI mode */
514+
priv->eee_sw_timer_en = true;
515+
stmmac_disable_hw_lpi_timer(priv);
521516
mod_timer(&priv->eee_ctrl_timer,
522517
STMMAC_LPI_T(priv->tx_lpi_timer));
523518
}

0 commit comments

Comments
 (0)