From: Wolfram Sang <wsa@the-dreams.de>
To: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
"David S. Miller" <davem@davemloft.net>,
Simon Horman <horms+renesas@verge.net.au>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Artemi Ivanov <artemi.ivanov@cogentembedded.com>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Subject: Re: [PATCH resend] can: rcar_canfd: fix possible IRQ storm on high load
Date: Wed, 26 Jun 2019 15:32:20 +0200 [thread overview]
Message-ID: <20190626133220.GK801@ninjato> (raw)
In-Reply-To: <20190626131251.GB801@ninjato>
[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]
On Wed, Jun 26, 2019 at 03:12:51PM +0200, Wolfram Sang wrote:
> On Wed, Jun 26, 2019 at 04:08:48PM +0300, Nikita Yushchenko wrote:
> > We have observed rcar_canfd driver entering IRQ storm under high load,
> > with following scenario:
> > - rcar_canfd_global_interrupt() in entered due to Rx available,
> > - napi_schedule_prep() is called, and sets NAPIF_STATE_SCHED in state
> > - Rx fifo interrupts are masked,
> > - rcar_canfd_global_interrupt() is entered again, this time due to
> > error interrupt (e.g. due to overflow),
> > - since scheduled napi poller has not yet executed, condition for calling
> > napi_schedule_prep() from rcar_canfd_global_interrupt() remains true,
> > thus napi_schedule_prep() gets called and sets NAPIF_STATE_MISSED flag
> > in state,
> > - later, napi poller function rcar_canfd_rx_poll() gets executed, and
> > calls napi_complete_done(),
> > - due to NAPIF_STATE_MISSED flag in state, this call does not clear
> > NAPIF_STATE_SCHED flag from state,
> > - on return from napi_complete_done(), rcar_canfd_rx_poll() unmasks Rx
> > interrutps,
> > - Rx interrupt happens, rcar_canfd_global_interrupt() gets called
> > and calls napi_schedule_prep(),
> > - since NAPIF_STATE_SCHED is set in state at this time, this call
> > returns false,
> > - due to that false return, rcar_canfd_global_interrupt() returns
> > without masking Rx interrupt
> > - and this results into IRQ storm: unmasked Rx interrupt happens again
> > and again is misprocessed in the same way.
> >
> > This patch fixes that scenario by unmasking Rx interrupts only when
> > napi_complete_done() returns true, which means it has cleared
> > NAPIF_STATE_SCHED in state.
> >
> > Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
>
> CCing the driver author...
Bounced :(
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2019-06-26 13:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 13:08 [PATCH resend] can: rcar_canfd: fix possible IRQ storm on high load Nikita Yushchenko
2019-06-26 13:12 ` Wolfram Sang
2019-06-26 13:32 ` Wolfram Sang [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=20190626133220.GK801@ninjato \
--to=wsa@the-dreams.de \
--cc=artemi.ivanov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=horms+renesas@verge.net.au \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=nikita.yoush@cogentembedded.com \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=wg@grandegger.com \
--cc=wsa+renesas@sang-engineering.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