From: Preeti U Murthy <preeti@linux.vnet.ibm.com>
To: benh@kernel.crashing.org, linux-kernel@vger.kernel.org,
svaidyan@in.ibm.com, paulus@samba.org,
srivatsa.bhat@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 1/6] powernv, cpuidle: Move the flags used for idle state discovery to powernv core
Date: Wed, 28 May 2014 10:08:47 +0530 [thread overview]
Message-ID: <20140528043847.15676.19985.stgit@preeti.in.ibm.com> (raw)
In-Reply-To: <20140528043703.15676.58580.stgit@preeti.in.ibm.com>
From: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
These flags will be used by the cpuidle driver as well as in the cpu
offline path. The offline cpus should be put to fastsleep if the idle state
is discovered so as to gain maximum power savings in the offline state.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
[ Changelog added by <preeti@linux.vnet.ibm.com> ]
Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/processor.h | 4 ++++
drivers/cpuidle/cpuidle-powernv.c | 7 +++----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index d660dc3..d922e5c 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -445,6 +445,10 @@ static inline unsigned long get_clean_sp(unsigned long sp, int is_32)
}
#endif
+/* Support for 'nap' and 'sleep' instructions, as discovered from the DT */
+#define IDLE_INST_NAP 0x00010000 /* nap instruction can be used */
+#define IDLE_INST_SLEEP 0x00020000 /* sleep instruction can be used */
+
extern unsigned long cpuidle_disable;
enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c
index 719f6fb..5d4f9e8 100644
--- a/drivers/cpuidle/cpuidle-powernv.c
+++ b/drivers/cpuidle/cpuidle-powernv.c
@@ -17,12 +17,11 @@
#include <asm/machdep.h>
#include <asm/firmware.h>
#include <asm/runlatch.h>
+#include <asm/processor.h>
/* Flags and constants used in PowerNV platform */
#define MAX_POWERNV_IDLE_STATES 8
-#define IDLE_USE_INST_NAP 0x00010000 /* Use nap instruction */
-#define IDLE_USE_INST_SLEEP 0x00020000 /* Use sleep instruction */
struct cpuidle_driver powernv_idle_driver = {
.name = "powernv_idle",
@@ -187,7 +186,7 @@ static int powernv_add_idle_states(void)
for (i = 0; i < dt_idle_states; i++) {
- if (flags[i] & IDLE_USE_INST_NAP) {
+ if (flags[i] & IDLE_INST_NAP) {
/* Add NAP state */
strcpy(powernv_states[nr_idle_states].name, "Nap");
strcpy(powernv_states[nr_idle_states].desc, "Nap");
@@ -198,7 +197,7 @@ static int powernv_add_idle_states(void)
nr_idle_states++;
}
- if (flags[i] & IDLE_USE_INST_SLEEP) {
+ if (flags[i] & IDLE_INST_SLEEP) {
/* Add FASTSLEEP state */
strcpy(powernv_states[nr_idle_states].name, "FastSleep");
strcpy(powernv_states[nr_idle_states].desc, "FastSleep");
next prev parent reply other threads:[~2014-05-28 4:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 4:38 [PATCH 0/6] ppc, kvm, cpuidle: Allow offline and kvm standby threads to enter fastsleep Preeti U Murthy
2014-05-28 4:38 ` Preeti U Murthy [this message]
2014-05-28 4:38 ` [PATCH 2/6] powerpc, powernv, CPU hotplug: Put offline CPUs in Fast-Sleep instead of Nap Preeti U Murthy
2014-06-05 4:23 ` Paul Mackerras
2014-05-28 4:39 ` [PATCH 3/6] KVM: PPC: Book3S HV: Enable CPUs to run guest after waking up from fast-sleep Preeti U Murthy
2014-05-28 4:39 ` [PATCH 4/6] KVM: PPC: Book3S HV: Consolidate the idle-state enter sequence in KVM Preeti U Murthy
2014-05-28 4:39 ` [PATCH 5/6] KVM: PPC: Book3S HV: Put KVM standby hwthreads to fast-sleep instead of nap Preeti U Murthy
2014-05-28 4:39 ` [PATCH 6/6] ppc, book3s: Go back to same idle state after handling machine check interrupt Preeti U Murthy
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=20140528043847.15676.19985.stgit@preeti.in.ibm.com \
--to=preeti@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=srivatsa.bhat@linux.vnet.ibm.com \
--cc=svaidyan@in.ibm.com \
/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).