Skip to content

Commit 91afbaa

Browse files
Song Shuaipalmer-dabbelt
authored andcommitted
riscv: hibernate: remove WARN_ON in save_processor_state
During hibernation or restoration, freeze_secondary_cpus checks num_online_cpus via BUG_ON, and the subsequent save_processor_state also does the checking with WARN_ON. In the case of CONFIG_PM_SLEEP_SMP=n, freeze_secondary_cpus is not defined, but the sole possible condition to disable CONFIG_PM_SLEEP_SMP is !SMP where num_online_cpus is always 1. We also don't have to check it in save_processor_state. So remove the unnecessary checking in save_processor_state. Fixes: c031721 ("RISC-V: Add arch functions to support hibernation/suspend-to-disk") Signed-off-by: Song Shuai <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent b5e13f3 commit 91afbaa

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/riscv/kernel/hibernate.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ int pfn_is_nosave(unsigned long pfn)
8080

8181
void notrace save_processor_state(void)
8282
{
83-
WARN_ON(num_online_cpus() != 1);
8483
}
8584

8685
void notrace restore_processor_state(void)

0 commit comments

Comments
 (0)