]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: stmmac: move setup of eee_ctrl_timer to stmmac_dvr_probe()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 8 Jan 2025 16:48:45 +0000 (16:48 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Jan 2025 01:51:02 +0000 (17:51 -0800)
Move the initialisation of the EEE software timer to the probe function
as it is unnecessary to do this each time we enable software LPI.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1tVZEb-0002L8-DJ@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 0a8885f1571a46503a68d9e05f741feed82f48b7..9564913726f432dfededa081b8d55c8976a77233 100644 (file)
@@ -494,7 +494,6 @@ static void stmmac_eee_init(struct stmmac_priv *priv, bool active)
        }
 
        if (priv->eee_active && !priv->eee_enabled) {
-               timer_setup(&priv->eee_ctrl_timer, stmmac_eee_ctrl_timer, 0);
                stmmac_set_eee_timer(priv, priv->hw, STMMAC_DEFAULT_LIT_LS,
                                     STMMAC_DEFAULT_TWT_LS);
                if (priv->hw->xpcs)
@@ -7413,6 +7412,8 @@ int stmmac_dvr_probe(struct device *device,
 
        INIT_WORK(&priv->service_task, stmmac_service_task);
 
+       timer_setup(&priv->eee_ctrl_timer, stmmac_eee_ctrl_timer, 0);
+
        /* Override with kernel parameters if supplied XXX CRS XXX
         * this needs to have multiple instances
         */