mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhu xin <zxyan0222@gmail.com>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: romain.gantois@bootlin.com, cathycai0714@gmail.com,
	avifishman70@gmail.com,  andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org,  kuba@kernel.org,
	pabeni@redhat.com, alexandre.torgue@foss.st.com,
	 netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] net: stmmac: Fix the problem about interrupt storm
Date: Wed, 25 Nov 2026 16:49:58 +0800	[thread overview]
Message-ID: <CAP7veTJnJEmqAr4pfzSwLPNHCFc=yuzzAbkeLEvAMjZf71-dcQ@mail.gmail.com> (raw)
In-Reply-To: <d515df02-0cb7-4641-a6ed-d73f2220f5c5@bootlin.com>

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
>

  reply	other threads:[~2026-11-25  8:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKKbWA7e0TmU4z4O8tHfwE=dvqPFaZbSPjxR-==fQSsNq6ELCQ@mail.gmail.com>
2024-11-03 19:00 ` Avi Fishman
2024-11-12 15:12   ` Romain Gantois
2026-11-25  7:57     ` Zxyan Zhu
2026-11-25  8:10       ` Maxime Chevallier
2026-11-25  8:49         ` zhu xin [this message]
2024-03-27 11:01 Cathy Cai
2024-03-31  8:35 ` Romain Gantois
2024-04-03  2:01   ` cathy cai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP7veTJnJEmqAr4pfzSwLPNHCFc=yuzzAbkeLEvAMjZf71-dcQ@mail.gmail.com' \
    --to=zxyan0222@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=avifishman70@gmail.com \
    --cc=cathycai0714@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=romain.gantois@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®