linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: move epapr paravirt init of power_save to an initcall
@ 2014-04-30 19:54 Stuart Yoder
  2014-04-30 19:56 ` Alexander Graf
  0 siblings, 1 reply; 8+ messages in thread
From: Stuart Yoder @ 2014-04-30 19:54 UTC (permalink / raw)
  To: benh, scottwood; +Cc: linuxppc-dev, agraf, Stuart Yoder

From: Stuart Yoder <stuart.yoder@freescale.com>

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.

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
 arch/powerpc/kernel/epapr_paravirt.c |   25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
index 6300c13..c49b69c 100644
--- a/arch/powerpc/kernel/epapr_paravirt.c
+++ b/arch/powerpc/kernel/epapr_paravirt.c
@@ -52,11 +52,6 @@ static int __init early_init_dt_scan_epapr(unsigned long node,
 #endif
 	}
 
-#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;
-#endif
-
 	epapr_paravirt_enabled = true;
 
 	return 1;
@@ -69,3 +64,23 @@ int __init epapr_paravirt_early_init(void)
 	return 0;
 }
 
+static int __init epapr_idle_init_dt_scan(unsigned long node,
+					   const char *uname,
+					   int depth, void *data)
+{
+#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;
+#endif
+	return 0;
+}
+
+static int __init epapr_idle_init(void)
+{
+	if (epapr_paravirt_enabled)
+		of_scan_flat_dt(epapr_idle_init_dt_scan, NULL);
+
+	return 0;
+}
+
+postcore_initcall(epapr_idle_init);
-- 
1.7.9.7

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-05-05 12:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-30 19:54 [PATCH] powerpc: move epapr paravirt init of power_save to an initcall Stuart Yoder
2014-04-30 19:56 ` Alexander Graf
2014-04-30 20:03   ` Stuart Yoder
2014-04-30 20:06     ` Alexander Graf
2014-04-30 20:09     ` Alexander Graf
2014-05-05 12:17       ` Tudor Laurentiu
2014-05-05 12:21         ` Alexander Graf
2014-05-05 12:35           ` Tudor Laurentiu

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).