[PATCH iwl-net 3/5] igb: let dev_watchdog reset the adapter after a Tx hang

From: Steffen Dirkwinkel

Date: Mon Nov 23 2026 - 04:56:19 EST


From: Steffen Dirkwinkel <s.dirkwinkel@xxxxxxxxxxxx>

Like e1000e, igb 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.

Until commit a22ed15c99a0 ("igb: Get rid of spurious interrupts") the
igb watchdog forced an interrupt every two seconds, so the hang was
reported every two seconds and the adapter was never reset. Since then
a report needs an interrupt from traffic, and the adapter is reset only
if a stopped queue sees none for 5 s.

Stop the queue only if it isn't stopped yet.

Found by code inspection after the same problem in e1000e. Tested on an
I210 with the Tx queues disabled through TXDCTL and that commit
reverted: without this change Tx never recovered in 8 of 8 tries, with
it the watchdog reset the adapter after 15 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/igb/igb_main.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 131df3e09ba1..0aca2e70087a 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -8484,8 +8484,15 @@ static bool igb_clean_tx_irq(struct igb_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