Skip to content

Commit

Permalink
powerpc/cpuidle: Handle power_save=off
Browse files Browse the repository at this point in the history
This patch makes pseries_idle_driver not to be registered when
power_save=off kernel boot option is specified. The
cpuidle_disable variable used here is similar to
its usage on x86. If cpuidle_disable is set then
sysfs entries for cpuidle framework are not created
and the required drivers are not loaded.

Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
Signed-off-by: Arun R Bharadwaj <arun.r.bharadwaj@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Deepthi Dharwar authored and Benjamin Herrenschmidt committed Dec 8, 2011
1 parent e179816 commit e8bb3e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ 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__ */
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/platforms/pseries/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ static int pseries_idle_probe(void)
if (!firmware_has_feature(FW_FEATURE_SPLPAR))
return -ENODEV;

if (cpuidle_disable != IDLE_NO_OVERRIDE)
return -ENODEV;

if (max_idle_state == 0) {
printk(KERN_DEBUG "pseries processor idle disabled.\n");
return -EPERM;
Expand Down

0 comments on commit e8bb3e0

Please sign in to comment.