When cpus != maxcpus cpuidle-haltpoll will fail to register all vcpus past the online ones and thus fail to register the idle driver. This is because cpuidle_add_sysfs() will return with -ENODEV as a consequence from get_cpu_device() return no device for a non-existing CPU. Instead switch to cpuidle_register_driver() and manually register each of the present cpus through cpuhp_setup_state() callbacks and future ones that get onlined or offlined. This mimmics similar logic that intel_idle does.
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -5,11 +5,11 @@ · 4 unmodified lines | |||
| 5 | #ifdef CONFIG_ARCH_CPUIDLE_HALTPOLL | 5 | #ifdef CONFIG_ARCH_CPUIDLE_HALTPOLL |
| 6 | #include <asm/cpuidle_haltpoll.h> | 6 | #include <asm/cpuidle_haltpoll.h> |
| 7 | #else | 7 | #else |
| 8 | static inline void arch_haltpoll_enable(void) | 8 | static inline void arch_haltpoll_enable(unsigned int cpu) |
| 9 | { | 9 | { |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | static inline void arch_haltpoll_disable(void) | 12 | static inline void arch_haltpoll_disable(unsigned int cpu) |
| 13 | { | 13 | { |
| 14 | } | 14 | } |
| 15 | #endif | 15 | #endif |