From: Jiri Slaby <jirislaby@kernel.org>
To: Alban Bedel <alban.bedel@lht.dlh.de>, linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, "Nam Cao" <namcao@linutronix.de>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Lennert Buytenhek" <buytenh@arista.com>,
"Peng Zhang" <zhangpeng.00@bytedance.com>,
stable@vger.kernel.org, "Muchun Song" <songmuchun@bytedance.com>,
"Maximilian Lueer" <maximilian.lueer@lht.dlh.de>
Subject: Re: [PATCH v3] serial: 8250: always disable IRQ during THRE test
Date: Thu, 12 Feb 2026 09:41:08 +0100 [thread overview]
Message-ID: <5964c41f-ddd3-406d-91b1-62fa33364163@kernel.org> (raw)
In-Reply-To: <20260209113207.2118445-1-alban.bedel@lht.dlh.de>
On 09. 02. 26, 12:32, Alban Bedel wrote:
> From: Peng Zhang <zhangpeng.00@bytedance.com>
>
> 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.
>
> Cc: stable@vger.kernel.org
> Fixes: 039d4926379b ("serial: 8250: Toggle IER bits on only after irq has been set up")
> Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> Signed-off-by: Alban Bedel <alban.bedel@lht.dlh.de>
> Tested-by: Maximilian Lueer <maximilian.lueer@lht.dlh.de>
> ---
> Changelog:
>
> 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.
thanks,
--
js
suse labs
next prev parent reply other threads:[~2026-02-12 8:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-09 11:32 [PATCH v3] serial: 8250: always disable IRQ during THRE test Alban Bedel
2026-02-12 8:41 ` Jiri Slaby [this message]
2026-02-12 10:15 ` Andy Shevchenko
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=5964c41f-ddd3-406d-91b1-62fa33364163@kernel.org \
--to=jirislaby@kernel.org \
--cc=alban.bedel@lht.dlh.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=buytenh@arista.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=maximilian.lueer@lht.dlh.de \
--cc=namcao@linutronix.de \
--cc=songmuchun@bytedance.com \
--cc=stable@vger.kernel.org \
--cc=zhangpeng.00@bytedance.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