🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Zxyan Zhu Wed, 25 Nov 2026 07:57
Re: [RFC PATCH] net: stmmac: Fix the problem about interrupt storm
#22374
Author: Zxyan Zhu
Date: Wed, 25 Nov 2026 07:57
48 lines
12761 bytes
Hello Romain, Cathy, Avi,

We hit exactly the interrupt-storm scenario you discussed, on a local board
running a PREEMPT_RT kernel, and I'd like to ask whether this series is
still being worked on.

Our setup and trigger:
- stmmac with dwxgmac2 (xgmac) and dwmac4 (gmac) MACs, kernel 6.18.34+
  with PREEMPT_RT and panic_on_rcu_stall.
- Trigger: fault-injection of an uncorrectable MAC safety error, which
  makes stmmac_global_err() schedule stmmac_reset_subtask(), i.e. 
  dev_close()/dev_open().

Symptom:
About 30 seconds after the injected error the board panics with an RCU
stall (rcu_preempt detected stalls, rcuc starved).

Root cause (confirmed on-board):
- The main level-triggered IRQ storms at roughly 820k irqs/sec during the
  reset window (irq count jumps from ~220k to ~23M in ~28s).
- stmmac_interrupt() returns IRQ_HANDLED without clearing any status while
  STMMAC_DOWN is set -- exactly the "unconditionally returning without
  clearing any interrupt flags" behaviour you flagged as dangerous.
- The level IRQ stays asserted -> infinite storm -> starves rcuc -> RCU
  grace period never converges -> panic.

This matches Romain's point: the unconditional early-return in the
STMMAC_DOWN state is the actual storm source, not the TMOUTEN/safety
watchdog.

Fix we validated:
disable_irq(priv->dev->irq) right after set_bit(STMMAC_DOWN, &priv->state)
in stmmac_reset_subtask(), before dev_close(). This masks the level IRQ
during the synchronize_net() window.

Results: irq count peaks at ~724 instead of ~23M.

Questions:
1. Is anyone still working on this series, or should we revive Cathy's RFC
   with the evidence above?
2. Would a patch along the lines of "disable_irq around the STMMAC_DOWN
   window" be acceptable, or do you prefer the more general approach you
   suggested -- wrapping the STMMAC_DOWN set/clear in a handler that also
   disables all interrupts?

Best regards,
Zxyan Zhu
Re: [RFC PATCH] net: stmmac: Fix the problem about interrupt storm
#22391
Author: zhu xin
Date: Wed, 25 Nov 2026 08:49
93 lines
15300 bytes
Hi Maxime,

On Wed, Nov 25, 2026 at 4:10 PM Maxime Chevallier
<maxime.chevallier@bootlin.com> wrote:
>
> Hi,
>
> On 11/25/26 08:57, Zxyan Zhu wrote:
> > Hello Romain, Cathy, Avi,
> >
> > We hit exactly the interrupt-storm scenario you discussed, on a local board
> > running a PREEMPT_RT kernel, and I'd like to ask whether this series is
> > still being worked on.
> >
> > Our setup and trigger:
> > - stmmac with dwxgmac2 (xgmac) and dwmac4 (gmac) MACs, kernel 6.18.34+
> >   with PREEMPT_RT and panic_on_rcu_stall.
> > - Trigger: fault-injection of an uncorrectable MAC safety error, which
> >   makes stmmac_global_err() schedule stmmac_reset_subtask(), i.e.
> >   dev_close()/dev_open().
> >
> > Symptom:
> > About 30 seconds after the injected error the board panics with an RCU
> > stall (rcu_preempt detected stalls, rcuc starved).
> >
> > Root cause (confirmed on-board):
> > - The main level-triggered IRQ storms at roughly 820k irqs/sec during the
> >   reset window (irq count jumps from ~220k to ~23M in ~28s).
> > - stmmac_interrupt() returns IRQ_HANDLED without clearing any status while
> >   STMMAC_DOWN is set -- exactly the "unconditionally returning without
> >   clearing any interrupt flags" behaviour you flagged as dangerous.
> > - The level IRQ stays asserted -> infinite storm -> starves rcuc -> RCU
> >   grace period never converges -> panic.
> >
> > This matches Romain's point: the unconditional early-return in the
> > STMMAC_DOWN state is the actual storm source, not the TMOUTEN/safety
> > watchdog.
>
> Taking a step back, I wonder if the right move is not to just get rid
> of STMMAC_DOWN entirely.
>
> It seems to me that it does not protect stuff that much, reading the
> different sites in the code where it's used... It just seems to cause
> more problems than it solves. All of them work without STMMAC_DOWN
> if I'm not mistaken.
>
> It's even misleading, as it's only set during a reset from the service
> reset subtask, while most of the callsites seem to assume this really
> means 'interface is down'.
>
> I think this is the better lead to follow there.


Thanks for the feedback. Agreed -- removing STMMAC_DOWN entirely is indeed
a cleaner fix than the interrupt-masking approach.

We'll try going in that direction, and report back if we make progress or
run into questions.

Best regards,
Zxyan Zhu


>
> Maxime
>
> >
> > Fix we validated:
> > disable_irq(priv->dev->irq) right after set_bit(STMMAC_DOWN, &priv->state)
> > in stmmac_reset_subtask(), before dev_close(). This masks the level IRQ
> > during the synchronize_net() window.
> >
> > Results: irq count peaks at ~724 instead of ~23M.
> >
> > Questions:
> > 1. Is anyone still working on this series, or should we revive Cathy's RFC
> >    with the evidence above?
> > 2. Would a patch along the lines of "disable_irq around the STMMAC_DOWN
> >    window" be acceptable, or do you prefer the more general approach you
> >    suggested -- wrapping the STMMAC_DOWN set/clear in a handler that also
> >    disables all interrupts?
> >
> > Best regards,
> > Zxyan Zhu
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads