Skip to content

Commit fd7df98

Browse files
nick650823gregkh
authored andcommitted
RISC-V: Enable the IPI before workqueue_online_cpu()
[ Upstream commit 3908ba2 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d4e7db7 commit fd7df98

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
@@ -147,6 +147,7 @@ enum cpuhp_state {
147147
CPUHP_AP_IRQ_LOONGARCH_STARTING,
148148
CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
149149
CPUHP_AP_IRQ_RISCV_IMSIC_STARTING,
150+
CPUHP_AP_IRQ_RISCV_SBI_IPI_STARTING,
150151
CPUHP_AP_ARM_MVEBU_COHERENCY,
151152
CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
152153
CPUHP_AP_PERF_X86_STARTING,

0 commit comments

Comments
 (0)