]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: move initialisation of priv->tx_lpi_timer to stmmac_open()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 23 Sep 2025 11:26:14 +0000 (12:26 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Sep 2025 00:40:22 +0000 (17:40 -0700)
The initialisation of priv->tx_lpi_timer only happens once during the
lifetime of the driver, which is during the initial administrative
open of the device. Move this initialisation out of __stmmac_open()
into stmmac_open().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/E1v119y-0000000774A-2vvl@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 8831bbda964c6a678d97543aed52ea143137fcf9..4acd180d2da84d079ea39ef5f6f4b25df139eb44 100644 (file)
@@ -3937,10 +3937,6 @@ static int __stmmac_open(struct net_device *dev,
        u32 chan;
        int ret;
 
-       /* Initialise the tx lpi timer, converting from msec to usec */
-       if (!priv->tx_lpi_timer)
-               priv->tx_lpi_timer = eee_timer * 1000;
-
        ret = stmmac_init_phy(dev);
        if (ret)
                return ret;
@@ -4004,6 +4000,10 @@ static int stmmac_open(struct net_device *dev)
        struct stmmac_dma_conf *dma_conf;
        int ret;
 
+       /* Initialise the tx lpi timer, converting from msec to usec */
+       if (!priv->tx_lpi_timer)
+               priv->tx_lpi_timer = eee_timer * 1000;
+
        dma_conf = stmmac_setup_dma_desc(priv, dev->mtu);
        if (IS_ERR(dma_conf))
                return PTR_ERR(dma_conf);