]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
RISC-V: Enable the IPI before workqueue_online_cpu()
authorNick Hu <nick.hu@sifive.com>
Wed, 17 Jul 2024 03:17:14 +0000 (11:17 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 1 Aug 2024 14:15:43 +0000 (07:15 -0700)
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: 63c5484e7495 ("workqueue: Add multiple affinity scopes and interface to select them")
Signed-off-by: Nick Hu <nick.hu@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20240717031714.1946036-1-nick.hu@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/sbi-ipi.c
include/linux/cpuhotplug.h

index 1026e22955ccc3a036e33c10bc1dd1324fce3667..0cc5559c08d8ff2c2e8a74bb9bbecfe8f383c104 100644 (file)
@@ -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_SBI_IPI_STARTING,
                          "irqchip/sbi-ipi:starting",
                          sbi_ipi_starting_cpu, NULL);
 
index 51ba681b915a979e5475eecf3fc89c71623b3af6..e30d93b807d5742c2ddb5033b9b58d0d20c95a25 100644 (file)
@@ -148,6 +148,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_SBI_IPI_STARTING,
        CPUHP_AP_ARM_MVEBU_COHERENCY,
        CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
        CPUHP_AP_PERF_X86_STARTING,