Skip to contentSkip to conversation

cpuidle: stub out cpuidle_poll_state_init() without CONFIG_CPU_IDLE

PATCH In review Arnd Bergmann 2 participants 2 messages Feb 20, 2018 CPU idle time management framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpuidle: stub out cpuidle_poll_state_init() without CONFIG_CPU_IDLE

Calling cpuidle_poll_state_init() from apm_init() results in a link failure since that directory is never entered without CONFIG_CPU_IDLE:

arch/x86/kernel/apm_32.o: In function `apm_init':
apm_32.c:(.init.text+0x62c): undefined reference to `cpuidle_poll_state_init'

CONFIG_ARCH_HAS_CPU_RELAX can be set without CONFIG_CPU_IDLE but has no effect then, so we should treat that configuration the same as if CONFIG_ARCH_HAS_CPU_RELAX was not set at all.

Fixes 34c2f65b718d ("cpuidle: Move polling state initialization code to separate file")
---
 include/linux/cpuidle.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/cpuidle.h +1 -1
index 871f9e21810c..0b3fc229086c 100644
@@ -225,7 +225,7 @@ static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev,
 }
 #endif
 
-#ifdef CONFIG_ARCH_HAS_CPU_RELAX
+#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_CPU_RELAX)
 void cpuidle_poll_state_init(struct cpuidle_driver *drv);
 #else
 static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {}
Signature · 1 line
2.9.0
#1 lore raw
Quoted 22 lines · CET Arnd Bergmann

Calling cpuidle_poll_state_init() from apm_init() results in a link failure since that directory is never entered without CONFIG_CPU_IDLE:

arch/x86/kernel/apm_32.o: In function `apm_init':
apm_32.c:(.init.text+0x62c): undefined reference to `cpuidle_poll_state_init'

CONFIG_ARCH_HAS_CPU_RELAX can be set without CONFIG_CPU_IDLE but has no effect then, so we should treat that configuration the same as if CONFIG_ARCH_HAS_CPU_RELAX was not set at all.

Fixes 34c2f65b718d ("cpuidle: Move polling state initialization code to separate file")
---
 include/linux/cpuidle.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/cpuidle.h +0 -0
index 871f9e21810c..0b3fc229086c 100644

include/linux/cpuidle.h static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, · line 231

Quoted 8 lines
include/linux/cpuidle.h +1 -1
@@ -225,7 +225,7 @@ static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev,
 }
 #endif
 
-#ifdef CONFIG_ARCH_HAS_CPU_RELAX
+#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_CPU_RELAX)
 void cpuidle_poll_state_init(struct cpuidle_driver *drv);
 #else
 static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {}

https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=pm-4.16-rc2&id=d7212cfb05ba802bea4dd6c90d61cfe6366ea224

is in the Linus' tree already.

Thanks,
Rafael