net: stmmac: fix timestamping configuration after suspend/resume
Subsystems (4)
PATCH 1/1 net: stmmac: fix timestamping configuration after suspend/resume
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.
---
I'm in two minds whether this should go via net or net-next - no one has noticed that getting the timestamp configuration after resume doesn't reflect the hardware state. Here's the commit that introduced the problem:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -0
@@ -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 ;
Signature · 1 line
2.47.3
Quoted 10 lines · Russell King (Oracle)
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.
Signed-off-by Russell King (Oracle) <[email protected]>
Quoted 8 lines
---
I'm in two minds whether this should go via net or net-next - no one has noticed that getting the timestamp configuration after resume doesn't reflect the hardware state. Here's the commit that introduced the problem:
Fixes d6228b7cdd6e ("net: stmmac: implement the SIOCGHWTSTAMP ioctl")
My feeling is that the bar is not if someone noticed or not. So I would lean towards a fix for net in this case.
Regardless, feel free to include:
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Mon, 23 Feb 2026 12:19:08 +0000 you wrote:
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.
[...]
Here is the summary with links:
- [net-next] net: stmmac: fix timestamping configuration after suspend/resume
https://git.kernel.org/netdev/net/c/2f61f38a2174
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html