[Skiboot] [PATCH 12/14] hw/slw: use dt_new_check()

Oliver O'Halloran oohall at gmail.com
Thu Jan 12 14:54:11 AEDT 2017


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 853ff6b6aefa..78a3e37f867a 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -648,11 +648,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.7.4



More information about the Skiboot mailing list