cpuidle: riscv: support non-SMP config
authorRandy Dunlap <rdunlap@infradead.org>
Sun, 3 Apr 2022 03:13:55 +0000 (20:13 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 20 Apr 2022 00:42:08 +0000 (17:42 -0700)
Add <asm/smp.h> for cpuid_to_hartid_map etc.
This is needed for both SMP and non-SMP builds, but not having it
causes a build error for non-SMP:

drivers/cpuidle/cpuidle-riscv-sbi.c: In function 'sbi_cpuidle_init_cpu':
drivers/cpuidle/cpuidle-riscv-sbi.c:350:26: error: implicit declaration of function 'cpuid_to_hartid_map' [-Werror=implicit-function-declaration]

Fixes: 6abf32f1d9c5 ("cpuidle: Add RISC-V SBI CPU idle driver")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
drivers/cpuidle/cpuidle-riscv-sbi.c

index b459eda2cd375f7f49cced69f6be831ac73c3de7..5c852e6719924bd74847c75ad6ab15e4496b17f4 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/pm_runtime.h>
 #include <asm/cpuidle.h>
 #include <asm/sbi.h>
+#include <asm/smp.h>
 #include <asm/suspend.h>
 
 #include "dt_idle_states.h"