Skip to contentSkip to conversation

powerpc: move epapr paravirt init of power_save to an initcall

PATCH Superseded Stuart Yoder 2 participants 2 messages Apr 30, 2014 PowerPC

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 powerpc: move epapr paravirt init of power_save to an initcall

From: Stuart Yoder <[email protected]>

some restructuring of epapr paravirt init resulted in ppc_md.power_save being set, and then overwritten to NULL during machine_init. This patch splits the initialization of ppc_md.power_save out into a postcore init call.

---
-v3
-changed approach slightly, set flag in the dt scanning
code and just look at that flag in the initcall

 arch/powerpc/kernel/epapr_paravirt.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/powerpc/kernel/epapr_paravirt.c +11 -1
index 7898be9..6596cd7 100644
@@ -30,6 +30,7 @@ extern u32 epapr_ev_idle_start[];
 #endif
 
 bool epapr_paravirt_enabled;
+bool epapr_has_idle;
 
 static int __init early_init_dt_scan_epapr(unsigned long node,
 					   const char *uname,
@@ -55,7 +56,7 @@ static int __init early_init_dt_scan_epapr(unsigned long node,
 
 #if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
 	if (of_get_flat_dt_prop(node, "has-idle", NULL))
-		ppc_md.power_save = epapr_ev_idle;
+		epapr_has_idle = true;
 #endif
 
 	epapr_paravirt_enabled = true;
@@ -70,3 +71,12 @@ int __init epapr_paravirt_early_init(void)
 	return 0;
 }
 
+static int __init epapr_idle_init(void)
+{
+	if (epapr_has_idle)
+		ppc_md.power_save = epapr_ev_idle;
+
+	return 0;
+}
+
+postcore_initcall(epapr_idle_init);
Signature · 1 line
1.7.9.7
#1 lore raw
Quoted 23 lines · Stuart Yoder

From: Stuart Yoder <[email protected]>

some restructuring of epapr paravirt init resulted in ppc_md.power_save being set, and then overwritten to NULL during machine_init. This patch splits the initialization of ppc_md.power_save out into a postcore init call.

---

(quoted diff) +0 -1
-v3
   -changed approach slightly, set flag in the dt scanning
    code and just look at that flag in the initcall
 
 
 arch/powerpc/kernel/epapr_paravirt.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/powerpc/kernel/epapr_paravirt.c +0 -0
index 7898be9..6596cd7 100644

arch/powerpc/kernel/epapr_paravirt.c extern u32 epapr_ev_idle_start[]; · line 33

Quoted 4 lines
arch/powerpc/kernel/epapr_paravirt.c +1 -0
@@ -30,6 +30,7 @@ extern u32 epapr_ev_idle_start[];
 #endif
 
 bool epapr_paravirt_enabled;
+bool epapr_has_idle;

static

-Scott