From cfdb14570c73fd71252fdda3be619399ed3c341d Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <>
Date: Thu, 2 Apr 2020 21:16:30 +0200
Subject: [PATCH 056/166] irq_poll: Use raise_softirq_irqoff() in cpu_dead

__raise_softirq_irqoff() adds a bit to the pending sofirq mask and this
is it. The softirq won't be handled in a deterministic way but randomly
when an interrupt fires and handles softirq in its irq_exit() routine or
if something randomly checks and handles pending softirqs in the call
chain before the CPU goes idle.

Add a local_bh_disable/enable() around the IRQ-off section which will
handle pending softirqs.

Signed-off-by: Sebastian Andrzej Siewior <>
 lib/irq_poll.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-5.15.32-rt39/lib/irq_poll.c
@ linux-5.15.32-rt39/lib/irq_poll.c:194 @ static int irq_poll_cpu_dead(unsigned in
 	 * If a CPU goes away, splice its entries to the current CPU
 	 * and trigger a run of the softirq
+	local_bh_disable();
 	list_splice_init(&per_cpu(blk_cpu_iopoll, cpu),
+	local_bh_enable();
 	return 0;