Skip to content

Commit 3908ba2

Browse files
nick650823palmer-dabbelt
authored andcommitted
RISC-V: Enable the IPI before workqueue_online_cpu()
Sometimes the hotplug cpu stalls at the arch_cpu_idle() for a while after workqueue_online_cpu(). When cpu stalls at the idle loop, the reschedule IPI is pending. However the enable bit is not enabled yet so the cpu stalls at WFI until watchdog timeout. Therefore enable the IPI before the workqueue_online_cpu() to fix the issue. Fixes: 63c5484 ("workqueue: Add multiple affinity scopes and interface to select them") Signed-off-by: Nick Hu <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 0c71005 commit 3908ba2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

arch/riscv/kernel/sbi-ipi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void __init sbi_ipi_init(void)
7171
* the masking/unmasking of virtual IPIs is done
7272
* via generic IPI-Mux
7373
*/
74-
cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
74+
cpuhp_setup_state(CPUHP_AP_IRQ_RISCV_SBI_IPI_STARTING,
7575
"irqchip/sbi-ipi:starting",
7676
sbi_ipi_starting_cpu, NULL);
7777

include/linux/cpuhotplug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ enum cpuhp_state {
148148
CPUHP_AP_IRQ_LOONGARCH_STARTING,
149149
CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
150150
CPUHP_AP_IRQ_RISCV_IMSIC_STARTING,
151+
CPUHP_AP_IRQ_RISCV_SBI_IPI_STARTING,
151152
CPUHP_AP_ARM_MVEBU_COHERENCY,
152153
CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
153154
CPUHP_AP_PERF_X86_STARTING,

0 commit comments

Comments
 (0)