Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Gantois <romain.gantois@bootlin.com>
To: cathycai0714@gmail.com,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Avi Fishman <avifishman70@gmail.com>
Cc: cathy.cai@unisoc.com, cixi.geng1@unisoc.com,
	David Miller <davem@davemloft.net>,
	edumazet@google.com, kuba@kernel.org,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-stm32@st-md-mailman.stormreply.com,
	mcoquelin.stm32@gmail.com,
	Network Development <netdev@vger.kernel.org>,
	pabeni@redhat.com, wade.shu@unisoc.com, xuewen.yan94@gmail.com,
	zhiguo.niu@unisoc.com, Alexandre Torgue <alexandre.torgue@st.com>,
	Murali <murali.somarouthu@dell.com>,
	Tomer Maimon <tmaimon77@gmail.com>,
	"Silva, L Antonio" <Luis.A.Silva@dell.com>,
	Arias Pablo <Pablo_Arias@dell.com>,
	Somarouthu Murali <Murali_Somarouthu@dell.com>,
	uri.trichter@nuvoton.com
Subject: Re: [RFC PATCH] net: stmmac: Fix the problem about interrupt storm
Date: Tue, 12 Nov 2024 16:12:17 +0100	[thread overview]
Message-ID: <7732873.EvYhyI6sBW@fw-rgant> (raw)
In-Reply-To: <CAKKbWA6zRee9Rzee-ebLnEAvwLqnmsPswGaUo_ineyzw-b=EgQ@mail.gmail.com>

Hello,

On dimanche 3 novembre 2024 20:00:54 heure normale d’Europe centrale Avi 
Fishman wrote:
> Hi all,
> 
...
> >  Yes. It could also happen between the dev_open() and
> > 
> > clear_bit(STMMAC_DOWN) calls.
> > Although we did not reproduce this scenario, it should have happened
> > if we had increased
> > the number of test samples. In addition, I found that other people had
> > similar problems before.
> > The link is:
> > https://lore.kernel.org/all/20210208140820.10410-11-Sergey.Semin@baikalele
> > ctronics.ru/> 
> > > Moreover, it seems strange to me that stmmac_interrupt()
> > > unconditionnally
> > > ignores interrupts when the driver is in STMMAC_DOWN state. This seems
> > > like
> > > dangerous behaviour, since it could cause IRQ storm issues whenever
> > > something in the driver sets this state. I'm not too familiar with the
> > > interrupt handling in this driver, but maybe stmmac_interrupt() could
> > > clear interrupts unconditionnally in the STMMAC_DOWN state?
> > 
> > Clear interrupts unconditionally in the STMMAC_DOWN state directly
> > certainly won't cause this problem.
> > This may be too rough, maybe this design has other considerations.
> 
> But then after the dev_open() you might miss interrupt, no?

Indeed, but in any case, unconditionally returning from an IRQ handler without 
clearing any interrupt flags seems like very strange behavior to me.

Disabling and reenabling interrupts as you suggested does seem like a
good solution for this particular scenario, but it doesn't solve the more
general issue of the dangerous way stmmac_interrupt handles this.

Maybe the setting and clearing of this STMMAC_DOWN bit should
be wrapped in some kind of handler which also disables all interrupts?

Best Regards

-- 
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com




      reply	other threads:[~2024-11-12 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKKbWA7e0TmU4z4O8tHfwE=dvqPFaZbSPjxR-==fQSsNq6ELCQ@mail.gmail.com>
2024-11-03 19:00 ` [RFC PATCH] net: stmmac: Fix the problem about interrupt storm Avi Fishman
2024-11-12 15:12   ` Romain Gantois [this message]

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=7732873.EvYhyI6sBW@fw-rgant \
    --to=romain.gantois@bootlin.com \
    --cc=Luis.A.Silva@dell.com \
    --cc=Murali_Somarouthu@dell.com \
    --cc=Pablo_Arias@dell.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=alexandre.torgue@st.com \
    --cc=avifishman70@gmail.com \
    --cc=cathy.cai@unisoc.com \
    --cc=cathycai0714@gmail.com \
    --cc=cixi.geng1@unisoc.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=murali.somarouthu@dell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=tmaimon77@gmail.com \
    --cc=uri.trichter@nuvoton.com \
    --cc=wade.shu@unisoc.com \
    --cc=xuewen.yan94@gmail.com \
    --cc=zhiguo.niu@unisoc.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