[PATCH 0/2] riscv: Fix cpu hotplug warnings
From: Rui Qi
Date: Thu Aug 13 2026 - 09:04:33 EST
This series fixes two issues with CPU hotplug on RISC-V that cause
spurious warnings when offlining CPUs.
Patch 1 fixes the immediate regression from commit 2b2b207e1162
("riscv: cpu_ops: Change return value type of cpu_is_stopped() to bool")
where the inverted warning condition triggers even when the
cpu_is_stopped callback is absent.
Patch 2 addresses the underlying race between the dying CPU and the
controlling CPU: the AP reports itself dead before it actually invokes
cpu_stop(), so the BP can observe the SBI HSM state as STARTED rather
than STOPPED. This was previously masked by the old semantics where
SBI_HSM_STATE_STARTED (0) was treated as success. The fix adds polling
with read_poll_timeout(), following the same approach as arm64's
cpu_psci_cpu_kill().
Rui Qi (2):
riscv: Fix spurious warning when cpu_is_stopped callback is absent
riscv: Poll for SBI_HSM_STATE_STOPPED in sbi_cpu_is_stopped()
arch/riscv/kernel/cpu-hotplug.c | 6 +-----
arch/riscv/kernel/cpu_ops_sbi.c | 13 ++++++++++---
2 files changed, 11 insertions(+), 8 deletions(-)
--
2.20.1