Skip to contentSkip to conversation

net: stmmac: fix incorrect flag check in timestamp interrupt

PATCH Applied Lai Peter Jun Ann 4 participants 4 messages Dec 18, 2023 – Dec 20, 2023

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

PATCH v2 1/1 net: stmmac: fix incorrect flag check in timestamp interrupt

The driver should continue get the timestamp if STMMAC_FLAG_EXT_SNAPSHOT_EN flag is set.

Fixes aa5513f5d95f ("net: stmmac: replace the ext_snapshot_en field with a flag")

---
v2 changelog:
- Add fix tag and [email protected] in email cc list.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +1 -1
index 540f6a4..f05bd75 100644
@@ -237,7 +237,7 @@ static void timestamp_interrupt(struct stmmac_priv *priv)
 	 */
 	ts_status = readl(priv->ioaddr + GMAC_TIMESTAMP_STATUS);
 
-	if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN)
+	if (!(priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN))
 		return;
 
 	num_snapshot = (ts_status & GMAC_TIMESTAMP_ATSNS_MASK) >>
Signature · 1 line
1.9.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 3 lines · Lai Peter Jun Ann

The driver should continue get the timestamp if STMMAC_FLAG_EXT_SNAPSHOT_EN flag is set.

Quoted 24 lines
Fixes aa5513f5d95f ("net: stmmac: replace the ext_snapshot_en field with a flag")

---
v2 changelog:
- Add fix tag and [email protected] in email cc list.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +1 -1
index 540f6a4..f05bd75 100644
@@ -237,7 +237,7 @@ static void timestamp_interrupt(struct stmmac_priv *priv)
 	 */
 	ts_status = readl(priv->ioaddr + GMAC_TIMESTAMP_STATUS);
 
-	if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN)
+	if (!(priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN))
 		return;
 
 	num_snapshot = (ts_status & GMAC_TIMESTAMP_ATSNS_MASK) >>
Reviewed-by on v2 1/1
#2 lore raw
In reply to Lai Peter Jun Ann
Quoted 7 lines · Lai Peter Jun Ann

The driver should continue get the timestamp if STMMAC_FLAG_EXT_SNAPSHOT_EN flag is set.

Fixes aa5513f5d95f ("net: stmmac: replace the ext_snapshot_en field with a flag")

Right. The blamed commit has wrongly converted that conditional statement.

-Serge(y)

Quoted 24 lines

---
v2 changelog:
- Add fix tag and [email protected] in email cc list.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +1 -1
index 540f6a4..f05bd75 100644
@@ -237,7 +237,7 @@ static void timestamp_interrupt(struct stmmac_priv *priv)
 	 */
 	ts_status = readl(priv->ioaddr + GMAC_TIMESTAMP_STATUS);
 
-	if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN)
+	if (!(priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN))
 		return;
 
 	num_snapshot = (ts_status & GMAC_TIMESTAMP_ATSNS_MASK) >>
Signature · 1 line
1.9.1
#3 lore raw
In reply to Lai Peter Jun Ann
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 9 lines · On Mon, 18 Dec 2023 15:51:32 +0800 you wrote:

The driver should continue get the timestamp if STMMAC_FLAG_EXT_SNAPSHOT_EN flag is set.

Fixes aa5513f5d95f ("net: stmmac: replace the ext_snapshot_en field with a flag")

[...]

Here is the summary with links:
- [net,v2,1/1] net: stmmac: fix incorrect flag check in timestamp interrupt

    https://git.kernel.org/netdev/net/c/bd7f77dae695

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html