[PATCH iwl-net 4/5] igc: let dev_watchdog reset the adapter after a Tx hang
From: Steffen Dirkwinkel
Date: Mon Nov 23 2026 - 04:56:16 EST
From: Steffen Dirkwinkel <s.dirkwinkel@xxxxxxxxxxxx>
Like e1000e and igb, igc stops the queue on every Tx hang report and
relies on dev_watchdog() to reset the adapter. Since commit
95ecba62e2fd ("net: fix races in netdev_tx_sent_queue()/dev_watchdog()")
every stop also writes trans_start, so the watchdog timeout can't
expire as long as the hang is reported again in time.
Since commit 8dcf2c212078 ("igc: Get rid of spurious interrupts") a
report needs an interrupt from traffic, and the adapter is reset only
if a stopped queue sees none for 5 s. The 6.1 and 6.6 stable trees have
the first commit but not the second: there the igc watchdog forces an
interrupt every two seconds and the adapter is never reset.
Stop the queue only if it isn't stopped yet.
Found by code inspection after the same problem in e1000e. Tested on an
I226-IT with the Tx queues disabled through TXDCTL and the second
commit reverted: without this change Tx never recovered in 8 of 8
tries, with it the watchdog reset the adapter after 14 to 17 s in 8 of
8. With unmodified interrupt handling Tx recovered with and without
this change.
Fixes: 95ecba62e2fd ("net: fix races in netdev_tx_sent_queue()/dev_watchdog()")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Steffen Dirkwinkel <s.dirkwinkel@xxxxxxxxxxxx>
---
drivers/net/ethernet/intel/igc/igc_main.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 1fb5f3cbe93c..a2d383f79a29 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -3281,8 +3281,15 @@ static bool igc_clean_tx_irq(struct igc_q_vector *q_vector, int napi_budget)
tx_buffer->next_to_watch,
jiffies,
tx_buffer->next_to_watch->wb.status);
- netif_stop_subqueue(tx_ring->netdev,
- tx_ring->queue_index);
+ /* The hang is reported again on every watchdog run,
+ * but stop the queue only once: stopping it again
+ * would also restart the Tx timeout, so dev_watchdog()
+ * would never reset the adapter.
+ */
+ if (!__netif_subqueue_stopped(tx_ring->netdev,
+ tx_ring->queue_index))
+ netif_stop_subqueue(tx_ring->netdev,
+ tx_ring->queue_index);
/* we are about to reset, no point in enabling stuff */
return true;
--
2.56.1