Skip to contentSkip to conversation

FAILED: patch "[PATCH] net: fix spurious TX timeout after dev_activate()" failed to apply to 5.15-stable tree

PATCH New [email protected] 2 participants 3 messages Sep 3 – Sep 9

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 82aeed2400786bd3f79d88cb8b8f42e6127e5923
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090352-dealmaker-grope-80e1@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 82aeed2400786bd3f79d88cb8b8f42e6127e5923 Mon Sep 17 00:00:00 2001
From: Breno Leitao <[email protected]>
Date: Tue, 25 Aug 2026 03:50:10 -0700
Subject: [PATCH] net: fix spurious TX timeout after dev_activate()

While debugging another issue today, I found out that my TX queue is reported as stopped for 4294907392 ms (49.7 days), on a machine that had been up for four minutes.

    bnxt_en 0002:01:00.0 eth0: NETDEV WATCHDOG: CPU: 28: transmit queue 23 timed out 4294907392 ms

4294907392 is not an elapsed time. It is the value of jiffies at that
moment: INITIAL_JIFFIES is 4294667296, which leaves jiffies 59 seconds short of wrapping.

dev_activate() runs transition_one_qdisc() over every TX queue, which resets trans_start to 0, and then stamps only queue 0 through netif_trans_update().

Stamp jiffies instead. A queue stopped across dev_activate() now gets a full watchdog_timeo of grace, and is still reported if it is stopped that long.

net/sched/sch_generic.c +1 -1
index ef2b4bf51564..4539dc2c6d38 100644
@@ -1278,7 +1278,7 @@ static void transition_one_qdisc(struct net_device *dev,
 
 	rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
 	if (need_watchdog_p) {
-		WRITE_ONCE(dev_queue->trans_start, 0);
+		WRITE_ONCE(dev_queue->trans_start, jiffies);
 		*need_watchdog_p = 1;
 	}
 }
maintainer
#1 lore raw

PATCH 1/2 net: annotate accesses to queue->trans_start

From: Eric Dumazet <[email protected]>

[ Upstream commit 5337824f4dc4bb26f38fbbba4ffb425a92803f15 ]

In following patches, dev_watchdog() will no longer stop all queues. It will read queue->trans_start locklessly.

Backport to 5.15: retain only the transition_one_qdisc() annotation needed by 82aeed2400786bd3f79d88cb8b8f42e6127e5923 ("net: fix spurious TX timeout after dev_activate()"). This preserves the zero timestamp while providing the WRITE_ONCE() context that the target changes to jiffies.

Drop the virtio hunk because this tree has no virtnet_tx_timeout(). Drop the other annotations and helper conversion because they are unrelated to the target; no new functions are introduced. The 5.15 watchdog still holds the transmit locks, so the broader lockless-access preparation is not required for this dependency.

[ sashal: Reduced backport -- upstream 5337824f4dc4b touches 14 file(s), this
backport carries 1. Not backported here:
drivers/net/ethernet/apm/xgene/xgene_enet_main.c drivers/net/ethernet/atheros/ag71xx.c drivers/net/ethernet/freescale/dpaa/dpaa_eth.c drivers/net/ethernet/hisilicon/hns3/hns3_enet.c drivers/net/ethernet/ibm/ibmvnic.c drivers/net/ethernet/intel/igb/igb_main.c drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
... and 5 more
This note is generated from the file lists only; see the resolution record for the reasoning. ]

Stable-dep-of: 82aeed240078 ("net: fix spurious TX timeout after dev_activate()")

---
 net/sched/sch_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_generic.c +1 -1
index 565970cca295b..f0036693df9e6 100644
@@ -1175,7 +1175,7 @@ static void transition_one_qdisc(struct net_device *dev,
 
 	rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
 	if (need_watchdog_p) {
-		dev_queue->trans_start = 0;
+		WRITE_ONCE(dev_queue->trans_start, 0);
 		*need_watchdog_p = 1;
 	}
 }
Signature · 1 line
2.53.0
maintainer
#2 lore raw

PATCH 2/2 net: fix spurious TX timeout after dev_activate()

From: Breno Leitao <[email protected]>

[ Upstream commit 82aeed2400786bd3f79d88cb8b8f42e6127e5923 ]

While debugging another issue today, I found out that my TX queue is reported as stopped for 4294907392 ms (49.7 days), on a machine that had been up for four minutes.

    bnxt_en 0002:01:00.0 eth0: NETDEV WATCHDOG: CPU: 28: transmit queue 23 timed out 4294907392 ms

4294907392 is not an elapsed time. It is the value of jiffies at that
moment: INITIAL_JIFFIES is 4294667296, which leaves jiffies 59 seconds short of wrapping.

dev_activate() runs transition_one_qdisc() over every TX queue, which resets trans_start to 0, and then stamps only queue 0 through netif_trans_update().

Stamp jiffies instead. A queue stopped across dev_activate() now gets a full watchdog_timeo of grace, and is still reported if it is stopped that long.

---
 net/sched/sch_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_generic.c +1 -1
index f0036693df9e6..2861473a118a5 100644
@@ -1175,7 +1175,7 @@ static void transition_one_qdisc(struct net_device *dev,
 
 	rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
 	if (need_watchdog_p) {
-		WRITE_ONCE(dev_queue->trans_start, 0);
+		WRITE_ONCE(dev_queue->trans_start, jiffies);
 		*need_watchdog_p = 1;
 	}
 }
Signature · 1 line
2.53.0