Loading arch/powerpc/Kconfig +4 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,10 @@ config ARCH_HAS_ILOG2_U64 bool default y if 64BIT config ARCH_HAS_CPU_IDLE_WAIT bool default y config GENERIC_HWEIGHT bool default y Loading arch/powerpc/include/asm/processor.h +3 −0 Original line number Diff line number Diff line Loading @@ -382,6 +382,9 @@ static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32) } #endif extern unsigned long cpuidle_disable; enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF}; #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ #endif /* _ASM_POWERPC_PROCESSOR_H */ arch/powerpc/include/asm/system.h +9 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,15 @@ extern unsigned long klimit; extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); extern int powersave_nap; /* set if nap mode can be used in idle loop */ void cpu_idle_wait(void); #ifdef CONFIG_PSERIES_IDLE extern void update_smt_snooze_delay(int snooze); extern int pseries_notify_cpuidle_add_cpu(int cpu); #else static inline void update_smt_snooze_delay(int snooze) {} static inline int pseries_notify_cpuidle_add_cpu(int cpu) { return 0; } #endif /* * Atomic exchange Loading arch/powerpc/kernel/idle.c +27 −0 Original line number Diff line number Diff line Loading @@ -39,9 +39,13 @@ #define cpu_should_die() 0 #endif unsigned long cpuidle_disable = IDLE_NO_OVERRIDE; EXPORT_SYMBOL(cpuidle_disable); static int __init powersave_off(char *arg) { ppc_md.power_save = NULL; cpuidle_disable = IDLE_POWERSAVE_OFF; return 0; } __setup("powersave=off", powersave_off); Loading Loading @@ -102,6 +106,29 @@ void cpu_idle(void) } } /* * cpu_idle_wait - Used to ensure that all the CPUs come out of the old * idle loop and start using the new idle loop. * Required while changing idle handler on SMP systems. * Caller must have changed idle handler to the new value before the call. * This window may be larger on shared systems. */ void cpu_idle_wait(void) { int cpu; smp_mb(); /* kick all the CPUs so that they exit out of old idle routine */ get_online_cpus(); for_each_online_cpu(cpu) { if (cpu != smp_processor_id()) smp_send_reschedule(cpu); } put_online_cpus(); } EXPORT_SYMBOL_GPL(cpu_idle_wait); int powersave_nap; #ifdef CONFIG_SYSCTL Loading arch/powerpc/kernel/sysfs.c +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <asm/machdep.h> #include <asm/smp.h> #include <asm/pmc.h> #include <asm/system.h> #include "cacheinfo.h" Loading Loading @@ -51,6 +52,7 @@ static ssize_t store_smt_snooze_delay(struct sys_device *dev, return -EINVAL; per_cpu(smt_snooze_delay, cpu->sysdev.id) = snooze; update_smt_snooze_delay(snooze); return count; } Loading Loading
arch/powerpc/Kconfig +4 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,10 @@ config ARCH_HAS_ILOG2_U64 bool default y if 64BIT config ARCH_HAS_CPU_IDLE_WAIT bool default y config GENERIC_HWEIGHT bool default y Loading
arch/powerpc/include/asm/processor.h +3 −0 Original line number Diff line number Diff line Loading @@ -382,6 +382,9 @@ static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32) } #endif extern unsigned long cpuidle_disable; enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF}; #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ #endif /* _ASM_POWERPC_PROCESSOR_H */
arch/powerpc/include/asm/system.h +9 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,15 @@ extern unsigned long klimit; extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); extern int powersave_nap; /* set if nap mode can be used in idle loop */ void cpu_idle_wait(void); #ifdef CONFIG_PSERIES_IDLE extern void update_smt_snooze_delay(int snooze); extern int pseries_notify_cpuidle_add_cpu(int cpu); #else static inline void update_smt_snooze_delay(int snooze) {} static inline int pseries_notify_cpuidle_add_cpu(int cpu) { return 0; } #endif /* * Atomic exchange Loading
arch/powerpc/kernel/idle.c +27 −0 Original line number Diff line number Diff line Loading @@ -39,9 +39,13 @@ #define cpu_should_die() 0 #endif unsigned long cpuidle_disable = IDLE_NO_OVERRIDE; EXPORT_SYMBOL(cpuidle_disable); static int __init powersave_off(char *arg) { ppc_md.power_save = NULL; cpuidle_disable = IDLE_POWERSAVE_OFF; return 0; } __setup("powersave=off", powersave_off); Loading Loading @@ -102,6 +106,29 @@ void cpu_idle(void) } } /* * cpu_idle_wait - Used to ensure that all the CPUs come out of the old * idle loop and start using the new idle loop. * Required while changing idle handler on SMP systems. * Caller must have changed idle handler to the new value before the call. * This window may be larger on shared systems. */ void cpu_idle_wait(void) { int cpu; smp_mb(); /* kick all the CPUs so that they exit out of old idle routine */ get_online_cpus(); for_each_online_cpu(cpu) { if (cpu != smp_processor_id()) smp_send_reschedule(cpu); } put_online_cpus(); } EXPORT_SYMBOL_GPL(cpu_idle_wait); int powersave_nap; #ifdef CONFIG_SYSCTL Loading
arch/powerpc/kernel/sysfs.c +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <asm/machdep.h> #include <asm/smp.h> #include <asm/pmc.h> #include <asm/system.h> #include "cacheinfo.h" Loading Loading @@ -51,6 +52,7 @@ static ssize_t store_smt_snooze_delay(struct sys_device *dev, return -EINVAL; per_cpu(smt_snooze_delay, cpu->sysdev.id) = snooze; update_smt_snooze_delay(snooze); return count; } Loading