Re: [PATCH v2] serial: 8250: fix shared IRQ startup race causing IRQ warning
From: Jiri Slaby
Date: Wed Jul 08 2026 - 02:03:27 EST
Ah, you are fixing the same thing as:
https://lore.kernel.org/all/20260707-bug-221579-8250-shared-irq-race-v6-1-f8c499a90bdd@xxxxxxxxx/
I did not look up who of you was first.
Note the above contains you in the commit log:
Reported-by: Wang Zhaolong <wangzhaolong@xxxxxxxxx>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221579
You both CCed each other, so you know the other's submission. I don't understand why you both send the patch? Anyway, you guys speak to each other and decide who sends the (fixed) patch.
On 08. 07. 26, 5:11, Wang Zhaolong wrote:
...
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -154,10 +152,18 @@ static struct irq_info *serial_get_or_create_irq_info(const struct uart_8250_por
static int serial_link_irq_chain(struct uart_8250_port *up)
{
struct irq_info *i;
int ret;
+ /*
+ * Keep the hash lock held until the first request_irq() completes.
+ * The first port publishes i->head before request_irq() starts the IRQ;
+ * a second port sharing the IRQ must not join the chain and run the
+ * THRE test while the IRQ core is still bringing the line up.
+ */
+ guard(mutex)(&hash_mutex);
The same as in the other patch:
hash_mutex is no longer an appropriate name for this lock.
+
i = serial_get_or_create_irq_info(up);
if (IS_ERR(i))
return PTR_ERR(i);
scoped_guard(spinlock_irq, &i->lock) {
thanks,
--
js
suse labs