Re: [PATCH 4/6] serial: 8250_dw: Rework IIR_NO_INT handling to stop interrupt storm
From: Andy Shevchenko
Date: Tue Jan 27 2026 - 08:59:20 EST
On Tue, Jan 27, 2026 at 03:01:46PM +0200, Ilpo Järvinen wrote:
> On Sat, 24 Jan 2026, Andy Shevchenko wrote:
> > On Fri, Jan 23, 2026 at 07:27:37PM +0200, Ilpo Järvinen wrote:
...
> > > + d->no_int_count++;
> > > + if (d->no_int_count > 2 && quirks & DW_UART_QUIRK_IER_KICK)
> > > + dw8250_quirk_ier_kick(p);
> >
> > Usual way is to use modulo. And perhaps use 4 for the sake of avoiding
> > division:
> >
> > if (d->no_int_count == 3 && quirks & DW_UART_QUIRK_IER_KICK)
> > dw8250_quirk_ier_kick(p);
> >
> > d->no_int_count = (d->no_int_count + 1) % 4;
>
> This doesn't look equivalent code as it only fires on 4th NO_INT,
Correct, I forgot to clarify this in my original reply. Yes, bumping to
power-of-two for simplicity, but as you noticed it bumps also the loop to
"every 4th". (I was under impression that I wrote it somewhere else in
the reply, but now I see it's not the case.)
> but I guess the difference doesn't matter that much so changing to your
> suggestion so that the kick will only occurs on fourth NO_INT interrupt.
> > where 4 may be defined with meaningful name. With that u8 is more than enough.
--
With Best Regards,
Andy Shevchenko