Skip to contentSkip to conversation

net: stmmac: fix timestamping configuration after suspend/resume

PATCH Applied Russell King (Oracle) 3 participants 3 messages Feb 23 – Feb 25

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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:

Fixes d6228b7cdd6e ("net: stmmac: implement the SIOCGHWTSTAMP ioctl")
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -0
index 89ded359a9fe..4c127b6b8c08 100644
@@ -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
reviewer Reviewed-by on v1 1/1
#1 lore raw
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.

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:

#2 lore raw
In reply to Russell King (Oracle)
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