From: Marc Zyngier <maz@kernel.org>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Biju Das <biju.das.au@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 3/3] irqchip: renesas-rzg2l: Fix irq storm with edge trigger detection for TINT
Date: Tue, 19 Sep 2023 17:19:05 +0100 [thread overview]
Message-ID: <87cyye3zly.wl-maz@kernel.org> (raw)
In-Reply-To: <OS0PR01MB5922748F489467BE2539AA1886FAA@OS0PR01MB5922.jpnprd01.prod.outlook.com>
On Tue, 19 Sep 2023 16:24:53 +0100,
Biju Das <biju.das.jz@bp.renesas.com> wrote:
>
> Hi Marc Zyngier,
>
> Thanks for the feedback.
>
> > Subject: Re: [PATCH 3/3] irqchip: renesas-rzg2l: Fix irq storm with edge
> > trigger detection for TINT
> >
> > On Mon, 18 Sep 2023 13:24:11 +0100,
> > Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > >
> > > In case of edge trigger detection, enabling the TINT source causes a
> > > phantum interrupt that leads to irq storm. So clear the phantum
> > > interrupt in rzg2l_irqc_irq_enable().
> > >
> > > This issue is observed when the irq handler disables the interrupts
> > > using
> > > disable_irq_nosync() and scheduling a work queue and in the work
> > > queue, re-enabling the interrupt with enable_irq().
> > >
> > > Fixes: 3fed09559cd8 ("irqchip: Add RZ/G2L IA55 Interrupt Controller
> > > driver")
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> > > ---
> > > drivers/irqchip/irq-renesas-rzg2l.c | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/drivers/irqchip/irq-renesas-rzg2l.c
> > > b/drivers/irqchip/irq-renesas-rzg2l.c
> > > index 33a22bafedcd..78a9e90512a6 100644
> > > --- a/drivers/irqchip/irq-renesas-rzg2l.c
> > > +++ b/drivers/irqchip/irq-renesas-rzg2l.c
> > > @@ -144,6 +144,12 @@ static void rzg2l_irqc_irq_enable(struct irq_data
> > *d)
> > > reg = readl_relaxed(priv->base + TSSR(tssr_index));
> > > reg |= (TIEN | tint) << TSSEL_SHIFT(tssr_offset);
> > > writel_relaxed(reg, priv->base + TSSR(tssr_index));
> > > + /*
> > > + * In case of edge trigger detection, enabling the TINT source
> > > + * cause a phantum interrupt that leads to irq storm. So clear
> > > + * the phantum interrupt.
> > > + */
> > > + rzg2l_tint_eoi(d);
> >
> > This looks incredibly unsafe. disable_irq()+enable_irq() with an interrupt
> > being made pending in the middle, and you've lost that interrupt.
>
> In this driver that will never happen as it clears the TINT source
> during disable(), so there won't be any TINT source for interrupt
> detection after disable().
So you mean that you *already* lose interrupts across a disable
followed by an enable? I'm slightly puzzled...
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2023-09-19 16:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 12:24 [PATCH 0/3] Fix IRQ storm with GPIO interrupts Biju Das
2023-09-18 12:24 ` [PATCH 1/3] irqchip: renesas-rzg2l: Fix logic to clear TINT interrupt source Biju Das
2023-09-18 12:38 ` Geert Uytterhoeven
2023-09-19 5:56 ` claudiu beznea
2023-09-24 9:31 ` [irqchip: irq/irqchip-fixes] " irqchip-bot for Biju Das
2023-09-18 12:24 ` [PATCH 2/3] irqchip: renesas-rzg2l: Mask interrupts for changing interrupt settings Biju Das
2023-09-24 9:27 ` Marc Zyngier
2023-09-25 8:51 ` Biju Das
2023-09-18 12:24 ` [PATCH 3/3] irqchip: renesas-rzg2l: Fix irq storm with edge trigger detection for TINT Biju Das
2023-09-19 14:37 ` Marc Zyngier
2023-09-19 15:24 ` Biju Das
2023-09-19 16:19 ` Marc Zyngier [this message]
2023-09-19 16:32 ` Biju Das
2023-09-19 16:49 ` Marc Zyngier
2023-09-19 17:06 ` Biju Das
2023-09-21 7:55 ` Marc Zyngier
2023-09-22 14:34 ` Biju Das
2023-10-06 10:46 ` Biju Das
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=87cyye3zly.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=biju.das.au@gmail.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=tglx@linutronix.de \
/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