net: stmmac: reduce unnecessary wakeups from eee sw timer
Subsystems (4)
PATCH 1/1 net: stmmac: reduce unnecessary wakeups from eee sw timer
Currently, on EEE capable platforms, if EEE SW timer is used, the SW timer cause 1 wakeup/s even if the TX has successfully entered EEE. Remove this unnecessary wakeup by only calling mod_timer() if we haven't successfully entered EEE.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +7 -6
@@ -402,7 +402,7 @@ static void stmmac_lpi_entry_timer_config(struct stmmac_priv *priv, bool en)* Description: this function is to verify and enter in LPI mode in case of * EEE. */ -static void stmmac_enable_eee_mode (struct stmmac_priv *priv) +static int stmmac_enable_eee_mode (struct stmmac_priv *priv) {u32 tx_cnt = priv->plat->tx_queues_to_use;u32 queue;
@@ -412,13 +412,14 @@ static void stmmac_enable_eee_mode(struct stmmac_priv *priv)struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];if (tx_q->dirty_tx != tx_q->cur_tx) -return ;/* still unfinished work */ +return -EBUSY ;/* still unfinished work */ }/* Check and enter in LPI mode */ if (!priv->tx_path_in_lpi_mode)stmmac_set_eee_mode (priv, priv->hw, priv->plat->en_tx_lpi_clockgating); +return 0 ; }/**
@@ -450,8 +451,8 @@ static void stmmac_eee_ctrl_timer(struct timer_list *t) {struct stmmac_priv *priv =from_timer (priv, t, eee_ctrl_timer); -stmmac_enable_eee_mode (priv); -mod_timer (&priv->eee_ctrl_timer,STMMAC_LPI_T (priv->tx_lpi_timer)); +if (stmmac_enable_eee_mode (priv)) +mod_timer (&priv->eee_ctrl_timer,STMMAC_LPI_T (priv->tx_lpi_timer)); }/**
@@ -2647,8 +2648,8 @@ static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)if (priv->eee_enabled && !priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en) { -stmmac_enable_eee_mode (priv); -mod_timer (&priv->eee_ctrl_timer,STMMAC_LPI_T (priv->tx_lpi_timer)); +if (stmmac_enable_eee_mode (priv)) +mod_timer (&priv->eee_ctrl_timer,STMMAC_LPI_T (priv->tx_lpi_timer)); }/* We still have pending packets, let's call for a new scheduling */
Signature · 1 line
2.34.1
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Sun, 23 Jan 2022 23:54:58 +0800 you wrote:
Currently, on EEE capable platforms, if EEE SW timer is used, the SW timer cause 1 wakeup/s even if the TX has successfully entered EEE. Remove this unnecessary wakeup by only calling
mod_timer()if we haven't successfully entered EEE.Signed-off-by Jisheng Zhang <[email protected]>[...]
Here is the summary with links:
- net: stmmac: reduce unnecessary wakeups from eee sw timer
https://git.kernel.org/netdev/net/c/c74ead223deb
You are awesome, thank you!
Signature · 9 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel