mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00

If we hotplug a core and then perform a suspend-to-RAM operation on a multi-core platform, the hotplugged CPU may be woken up along with the rest of the system, particularly on platforms that wake all cores from the deepest sleep state. When this happens, the hotplugged CPU enters the sbi_hsm_wait WFI wait loop instead of transitioning into a platform-specific low-power state. To address this, we add a HSM stop call within the wait loop. This allows platforms that support HSM stop to enter a low-power state when the CPU is unexpectedly woken up. Signed-off-by: Nick Hu <nick.hu@sifive.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20250418064506.15771-1-nick.hu@sifive.com Signed-off-by: Anup Patel <anup@brainfault.org>