RISC-V: Enable the IPI before workqueue_online_cpu()
Subsystems (2)
PATCH 1/1 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.
--- arch/riscv/kernel/sbi-ipi.c | 2 +- include/linux/cpuhotplug.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
arch/riscv/kernel/sbi-ipi.c +1 -1
@@ -71,7 +71,7 @@ void __init sbi_ipi_init(void)* the masking/unmasking of virtual IPIs is done * via generic IPI-Mux */ -cpuhp_setup_state (CPUHP_AP_ONLINE_DYN , +cpuhp_setup_state (CPUHP_AP_IRQ_RISCV_SWINT_STARTING ,"irqchip/sbi-ipi:starting" , sbi_ipi_starting_cpu,NULL );
include/linux/cpuhotplug.h +1 -0
@@ -147,6 +147,7 @@ enum cpuhp_state {CPUHP_AP_IRQ_LOONGARCH_STARTING ,CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING ,CPUHP_AP_IRQ_RISCV_IMSIC_STARTING , +CPUHP_AP_IRQ_RISCV_SWINT_STARTING ,CPUHP_AP_ARM_MVEBU_COHERENCY ,CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING , CPUHP_AP_PERF_X86_STARTING,
Signature · 1 line
2.34.1
Quoted 32 lines · Nick Hu
Sometimes the hotplug cpu stalls at the
arch_cpu_idle()for a while afterworkqueue_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 theworkqueue_online_cpu()to fix the issue.Fixes 63c5484e7495 ("workqueue: Add multiple affinity scopes and interface to select them")Signed-off-by Nick Hu <[email protected]>--- arch/riscv/kernel/sbi-ipi.c | 2 +- include/linux/cpuhotplug.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)arch/riscv/kernel/sbi-ipi.c +1
-1@@ -71,7 +71,7 @@ void __init sbi_ipi_init(void)* the masking/unmasking of virtual IPIs is done * via generic IPI-Mux */ -cpuhp_setup_state (CPUHP_AP_ONLINE_DYN , +cpuhp_setup_state (CPUHP_AP_IRQ_RISCV_SWINT_STARTING ,"irqchip/sbi-ipi:starting" , sbi_ipi_starting_cpu,NULL );include/linux/cpuhotplug.h +0
-0
include/linux/cpuhotplug.h enum cpuhp_state { · line 150
Quoted 4 lines
include/linux/cpuhotplug.h +1
-0@@ -147,6 +147,7 @@ enum cpuhp_state {CPUHP_AP_IRQ_LOONGARCH_STARTING ,CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING ,CPUHP_AP_IRQ_RISCV_IMSIC_STARTING , + CPUHP_AP_IRQ_RISCV_SWINT_STARTING,
This is a misleading name.
I suggest s/_RISCV_SWINT_/_RISCV_SBI_IPI_/ .
Quoted 6 lines
include/linux/cpuhotplug.h +0
-1CPUHP_AP_ARM_MVEBU_COHERENCY ,CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING , CPUHP_AP_PERF_X86_STARTING, --2.34.1
Regards,
Anup
Hi Anup
Quoted 41 lines · Anup Patel
Quoted 32 lines · Nick Hu
Sometimes the hotplug cpu stalls at the
arch_cpu_idle()for a while afterworkqueue_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 theworkqueue_online_cpu()to fix the issue.Fixes 63c5484e7495 ("workqueue: Add multiple affinity scopes and interface to select them")Signed-off-by Nick Hu <[email protected]>--- arch/riscv/kernel/sbi-ipi.c | 2 +- include/linux/cpuhotplug.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)arch/riscv/kernel/sbi-ipi.c +1
-1@@ -71,7 +71,7 @@ void __init sbi_ipi_init(void)* the masking/unmasking of virtual IPIs is done * via generic IPI-Mux */ -cpuhp_setup_state (CPUHP_AP_ONLINE_DYN , +cpuhp_setup_state (CPUHP_AP_IRQ_RISCV_SWINT_STARTING ,"irqchip/sbi-ipi:starting" , sbi_ipi_starting_cpu,NULL );include/linux/cpuhotplug.h +0
-0include/linux/cpuhotplug.h enum cpuhp_state { · line 150
Quoted 4 lines
include/linux/cpuhotplug.h +1
-0@@ -147,6 +147,7 @@ enum cpuhp_state {CPUHP_AP_IRQ_LOONGARCH_STARTING ,CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING ,CPUHP_AP_IRQ_RISCV_IMSIC_STARTING , + CPUHP_AP_IRQ_RISCV_SWINT_STARTING,This is a misleading name.
Quoted 2 lines
I suggest s/_RISCV_SWINT_/_RISCV_SBI_IPI_/ .
Good point.
I'll update it in the next version.
Thank you for the feedback.
Quoted 9 lines
Quoted 6 lines
include/linux/cpuhotplug.h +0
-1CPUHP_AP_ARM_MVEBU_COHERENCY ,CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING , CPUHP_AP_PERF_X86_STARTING, --2.34.1
Regards,
Anup
Regards,
Nick