[v4 PATCH 3/5]: pSeries: Incorporate registering of idle loop for pSeries.

Arun R Bharadwaj arun at linux.vnet.ibm.com
Tue Sep 1 21:40:36 EST 2009


* Arun R Bharadwaj <arun at linux.vnet.ibm.com> [2009-09-01 17:07:04]:

Platform needs to register its idle function via register_idle_function()
in order to provide a clean way of handling the ppc_md.power_save

Signed-off-by: Arun R Bharadwaj <arun at linux.vnet.ibm.com>
---
 arch/powerpc/platforms/pseries/setup.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Index: linux.trees.git/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/platforms/pseries/setup.c
+++ linux.trees.git/arch/powerpc/platforms/pseries/setup.c
@@ -280,6 +280,8 @@ static struct notifier_block pci_dn_reco
 
 static void __init pSeries_setup_arch(void)
 {
+	struct idle_function_desc pseries_idle_desc;
+
 	/* Discover PIC type and setup ppc_md accordingly */
 	pseries_discover_pic();
 
@@ -305,10 +307,17 @@ static void __init pSeries_setup_arch(vo
 		vpa_init(boot_cpuid);
 		if (get_lppaca()->shared_proc) {
 			printk(KERN_DEBUG "Using shared processor idle loop\n");
-			ppc_md.power_save = pseries_shared_idle_sleep;
+			//snprintf(pseries_idle_desc.name, 16, "shared_loop");
+			pseries_idle_desc.name = "shared_loop";
+			pseries_idle_desc.idle_func = pseries_shared_idle_sleep;
+			register_idle_function(&pseries_idle_desc);
 		} else {
 			printk(KERN_DEBUG "Using dedicated idle loop\n");
-			ppc_md.power_save = pseries_dedicated_idle_sleep;
+			//snprintf(pseries_idle_desc.name, 16, "dedicated_loop");
+			pseries_idle_desc.name = "dedicated_loop";
+			pseries_idle_desc.idle_func =
+						pseries_dedicated_idle_sleep;
+			register_idle_function(&pseries_idle_desc);
 		}
 	} else {
 		printk(KERN_DEBUG "Using default idle loop\n");


More information about the Linuxppc-dev mailing list