Re: [PATCH v3] serial: 8250: always disable IRQ during THRE test
From: Andy Shevchenko
Date: Thu Feb 12 2026 - 05:19:02 EST
On Thu, Feb 12, 2026 at 09:41:08AM +0100, Jiri Slaby wrote:
> On 09. 02. 26, 12:32, Alban Bedel wrote:
> > commit 039d4926379b ("serial: 8250: Toggle IER bits on only after irq
> > has been set up") moved IRQ setup before the THRE test, so the interrupt
> > handler can run during the test and race with its IIR reads. This can
> > produce wrong THRE test results and cause spurious registration of the
> > serial8250_backup_timeout timer. Unconditionally disable the IRQ for the
> > short duration of the test and re-enable it afterwards to avoid the race.
...
> > v2: Replaced disable_irq_nosync() with disable_irq() to prevent interrupts
> > that are currently being handled
>
> This made me to check, why/how this is possible. It appears to be, but only
> thanks to:
> 205d300aea75 serial: 8250: change lock order in serial8250_do_startup()
>
> And the change should be documented in the commit log. Especially to avoid
> stable backports to trees without 205d300aea75.
There is a de facto tag Depends-on: which might be used here.
--
With Best Regards,
Andy Shevchenko