[Skiboot] [RFC PATCH 4/5] hw/slw: use dt_new_check()

Oliver O'Halloran oohall at gmail.com
Fri Sep 16 16:45:02 AEST 2016


On P9 systems the /ibm,opal/power-mgt/ node may be created by the HDAT
parser before reaching add_cpu_idle_state_properties(). This is fine,
but it needs to be handled.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 hw/slw.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/slw.c b/hw/slw.c
index 09e8d1d54bec..62822dfaefdf 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -584,11 +584,10 @@ void add_cpu_idle_state_properties(void)
 	u32 *residency_ns_buf;
 	u32 *flags_buf;
 
-
 	prlog(PR_DEBUG, "CPU idle state device tree init\n");
 
-	/* Create /ibm,opal/power-mgt */
-	power_mgt = dt_new(opal_node, "power-mgt");
+	/* Create /ibm,opal/power-mgt if it doesn't exist already */
+	power_mgt = dt_new_check(opal_node, "power-mgt");
 	if (!power_mgt) {
 		/**
 		 * @fwts-label CreateDTPowerMgtNodeFail
-- 
2.5.5



More information about the Skiboot mailing list