From b0c525095c25e3df67cc0e06257995123cc7e75b Mon Sep 17 00:00:00 2001 From: Yong-Xuan Wang Date: Sun, 3 May 2026 23:05:02 -0700 Subject: [PATCH] irqchip/riscv-imsic: sync-up state before CPU offline The "move_prev" pointer in struct imsic_vector on the new CPU is cleared only after the old CPU has cleared "move_next". But when migrating all the interrupts out from an offling CPU, since the CPU is already marked as "offlined", the IMSIC driver skip to sync-up the interrupt vector in __imsic_remote_sync(). The "move_pre" pointer of these interrupts can only be cleared after the old CPU backs to online. Therefore the affinity of an interrupt that are orignally target an offlined CPU can't be changed. This patch force to clear the "move_pre" pointers before the CPU goes offline. Signed-off-by: Yong-Xuan Wang Signed-off-by: Linux RISC-V bot --- drivers/irqchip/irq-riscv-imsic-early.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-riscv-imsic-early.c b/drivers/irqchip/irq-riscv-imsic-early.c index ba903fa689bd52..a7a1852b548c48 100644 --- a/drivers/irqchip/irq-riscv-imsic-early.c +++ b/drivers/irqchip/irq-riscv-imsic-early.c @@ -158,6 +158,8 @@ static int imsic_dying_cpu(unsigned int cpu) /* Cleanup IPIs */ imsic_ipi_dying_cpu(); + imsic_local_sync_all(false); + /* Mark per-CPU IMSIC state as offline */ imsic_state_offline();