Skip to contentSkip to conversation

powernv/cpuidle: Back-end cpuidle driver for powernv platform for idle state management.

PATCH New Deepthi Dharwar 1 participant 2 messages Jan 14, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powernv/cpuidle: Back-end cpuidle driver for powernv platform for idle state management.

Following patch ports the cpuidle framework for powernv platform and also implements a cpuidle back-end powernv idle driver calling on to power7_nap and snooze idle states.

Moving the idle states over to cpuidle framework can take advantage of advanced heuristics, tunables and features provided by cpuidle framework. Additional idle states can be exploited using the cpuidle framework. The statistics and tracing infrastructure provided by the cpuidle framework also helps in enabling power management related tools and help tune the system and applications.

This series aims to maintain compatibility and functionality to existing powernv idle cpu management code. There are no new functions or idle states added as part of this series. This can be extended by adding more states to this existing framework.

For POWERNV platform to hook into CPUIDLE framework, one needs to enable CONFIG_POWERNV_IDLE.

This patch series applies on pseries cpuidle backend driver fixes patchset posted earlier.
pseries/cpuidle: pseries cpuidle backend driver clean-ups.

Deepthi Dharwar (1):
powernv/cpuidle: Back-end cpuidle driver for powernv platform.

 arch/powerpc/platforms/powernv/setup.c |   13 ++
 drivers/cpuidle/Kconfig.powerpc        |    9 ++
 drivers/cpuidle/Makefile               |    1 
 drivers/cpuidle/cpuidle-powernv.c      |  169 ++++++++++++++++++++++++++++++++
 4 files changed, 191 insertions(+), 1 deletion(-)
 create mode 100644 drivers/cpuidle/cpuidle-powernv.c

-- Deepthi

#1 lore raw

PATCH 1/1 powernv/cpuidle: Back-end cpuidle driver for powernv platform.

Following patch ports the cpuidle framework for powernv platform and also implements a cpuidle back-end powernv idle driver calling on to power7_nap and snooze idle states.

---
 arch/powerpc/platforms/powernv/setup.c |   13 ++
 drivers/cpuidle/Kconfig.powerpc        |    9 ++
 drivers/cpuidle/Makefile               |    1 
 drivers/cpuidle/cpuidle-powernv.c      |  169 ++++++++++++++++++++++++++++++++
 4 files changed, 191 insertions(+), 1 deletion(-)
 create mode 100644 drivers/cpuidle/cpuidle-powernv.c
arch/powerpc/platforms/powernv/setup.c +12 -1
index 19884b2..764a14e 100644
@@ -26,6 +26,7 @@
 #include <linux/of_fdt.h>
 #include <linux/interrupt.h>
 #include <linux/bug.h>
+#include <linux/cpuidle.h>
 
 #include <asm/machdep.h>
 #include <asm/firmware.h>
@@ -214,6 +215,16 @@ static int __init pnv_probe(void)
 	return 1;
 }
 
+void powernv_idle(void)
+{
+	/* Hook to cpuidle framework if available, else
+	 * call on default platform idle code
+	 */
+	if (cpuidle_idle_call()) {
+		power7_idle();
+	}
+}
+
 define_machine(powernv) {
 	.name			= "PowerNV",
 	.probe			= pnv_probe,
@@ -223,7 +234,7 @@ define_machine(powernv) {
 	.show_cpuinfo		= pnv_show_cpuinfo,
 	.progress		= pnv_progress,
 	.machine_shutdown	= pnv_shutdown,
-	.power_save             = power7_idle,
+	.power_save             = powernv_idle,
 	.calibrate_decr		= generic_calibrate_decr,
 #ifdef CONFIG_KEXEC
 	.kexec_cpu_down		= pnv_kexec_cpu_down,
drivers/cpuidle/Kconfig.powerpc +9 -0
index 8147de5..66c3a09 100644
@@ -9,3 +9,12 @@ config PSERIES_CPUIDLE
 	help
 	  Select this option to enable processor idle state management
 	  through cpuidle subsystem.
+
+config POWERNV_CPUIDLE
+	bool "Cpuidle driver for powernv platforms"
+	depends on CPU_IDLE
+	depends on PPC_POWERNV
+	default y
+	help
+	  Select this option to enable processor idle state management
+	  through cpuidle subsystem.
drivers/cpuidle/Makefile +1 -0
index a6331ad..f71ae1b 100644
@@ -17,3 +17,4 @@ obj-$(CONFIG_ARM_AT91_CPUIDLE)          += cpuidle-at91.o
 ###############################################################################
 # POWERPC drivers
 obj-$(CONFIG_PSERIES_CPUIDLE)		+= cpuidle-pseries.o
+obj-$(CONFIG_POWERNV_CPUIDLE)		+= cpuidle-powernv.o
drivers/cpuidle/cpuidle-powernv.c new file +169 -0

169 lines not on this page · raw message