]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: fix timestamping configuration after suspend/resume
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 23 Feb 2026 12:19:08 +0000 (12:19 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 25 Feb 2026 01:46:15 +0000 (17:46 -0800)
When stmmac_init_timestamping() is called, it clears the receive and
transmit path booleans that allow timestamps to be read. These are
never re-initialised until after userspace requests timestamping
features to be enabled.

However, our copy of the timestamp configuration is not cleared, which
means we return the old configuration to userspace when requested.
This is inconsistent. Fix this by clearing the timestamp configuration.

Fixes: d6228b7cdd6e ("net: stmmac: implement the SIOCGHWTSTAMP ioctl")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/E1vuUu4-0000000Afea-0j9B@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 82375d34ad57d62d3632169546b4787c47850dee..91f638ce132eaf5a4631a94fcb7d97b2c83aea31 100644 (file)
@@ -853,6 +853,7 @@ static int stmmac_init_timestamping(struct stmmac_priv *priv)
                netdev_info(priv->dev,
                            "IEEE 1588-2008 Advanced Timestamp supported\n");
 
+       memset(&priv->tstamp_config, 0, sizeof(priv->tstamp_config));
        priv->hwts_tx_en = 0;
        priv->hwts_rx_en = 0;