linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Trinabh Gupta <trinabh@linux.vnet.ibm.com>
To: linux-pm@lists.linux-foundation.org, linuxppc-dev@ozlabs.org
Cc: linux-kernel@vger.kernel.org
Subject: [RFC PATCH V1 7/7] cpuidle: (POWER) Handle power_save=off
Date: Tue, 07 Jun 2011 22:00:38 +0530	[thread overview]
Message-ID: <20110607163033.6848.70719.stgit@tringupt.in.ibm.com> (raw)
In-Reply-To: <20110607162847.6848.44707.stgit@tringupt.in.ibm.com>

This patch makes pseries_idle_driver to be not registered when
power_save=off kernel boot option is specified. For this
boot_option_idle_override is used similar to how it is used for x86.

Signed-off-by: Trinabh Gupta <trinabh@linux.vnet.ibm.com>
Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
---

 arch/powerpc/include/asm/processor.h            |    3 +++
 arch/powerpc/kernel/idle.c                      |    4 ++++
 arch/powerpc/platforms/pseries/processor_idle.c |    4 ++++
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index d50c2b6..0ce167e 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -377,6 +377,9 @@ static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32)
 }
 #endif
 
+extern unsigned long  boot_option_idle_override;
+enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
+
 #endif /* __KERNEL__ */
 #endif /* __ASSEMBLY__ */
 #endif /* _ASM_POWERPC_PROCESSOR_H */
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index 932392b..61515f4 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -39,9 +39,13 @@
 #define cpu_should_die()	0
 #endif
 
+unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE;
+EXPORT_SYMBOL(boot_option_idle_override);
+
 static int __init powersave_off(char *arg)
 {
 	ppc_md.power_save = NULL;
+	boot_option_idle_override = IDLE_POWERSAVE_OFF;
 	return 0;
 }
 __setup("powersave=off", powersave_off);
diff --git a/arch/powerpc/platforms/pseries/processor_idle.c b/arch/powerpc/platforms/pseries/processor_idle.c
index ff44b49..c4c3383 100644
--- a/arch/powerpc/platforms/pseries/processor_idle.c
+++ b/arch/powerpc/platforms/pseries/processor_idle.c
@@ -288,6 +288,10 @@ static int pseries_idle_probe(void)
 		return -EPERM;
 	}
 
+	if (boot_option_idle_override != IDLE_NO_OVERRIDE) {
+		return -ENODEV;
+	}
+
 	if (!firmware_has_feature(FW_FEATURE_SPLPAR)) {
 		printk(KERN_DEBUG "Using default idle\n");
 		return -ENODEV;

      parent reply	other threads:[~2011-06-07 16:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 16:29 [RFC PATCH V1 0/7] cpuidle: (POWER) cpuidle driver for pSeries Trinabh Gupta
2011-06-07 16:29 ` [RFC PATCH V1 1/7] cpuidle: create bootparam "cpuidle.off=1" Trinabh Gupta
2011-06-17  4:29   ` Benjamin Herrenschmidt
2011-06-21  4:36     ` Trinabh Gupta
2011-06-07 16:29 ` [RFC PATCH V1 2/7] cpuidle: replace xen access to x86 pm_idle and default_idle Trinabh Gupta
2011-06-07 16:29 ` [RFC PATCH V1 3/7] cpuidle: stop using pm_idle Trinabh Gupta
2011-08-03 17:45   ` Len Brown
2011-06-07 16:30 ` [RFC PATCH V1 4/7] cpuidle: (powerpc) Add cpu_idle_wait() to allow switching idle routines Trinabh Gupta
2011-06-17  4:32   ` Benjamin Herrenschmidt
2011-06-21  6:00     ` Trinabh Gupta
2011-06-07 16:30 ` [RFC PATCH V1 5/7] cpuidle: (POWER) cpuidle driver for pSeries Trinabh Gupta
2011-06-17  4:36   ` Benjamin Herrenschmidt
2011-06-21  9:00     ` Trinabh Gupta
2011-06-07 16:30 ` [RFC PATCH V1 6/7] cpuidle: (POWER) Enable cpuidle and directly call cpuidle_idle_call() " Trinabh Gupta
2011-06-07 16:30 ` Trinabh Gupta [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110607163033.6848.70719.stgit@tringupt.in.ibm.com \
    --to=trinabh@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).