diff mbox series

fast-reboot: occ: Delete OCC child nodes in /ibm, opal/power-mgt

Message ID 1519796117-27998-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com
State Accepted
Headers show
Series fast-reboot: occ: Delete OCC child nodes in /ibm, opal/power-mgt | expand

Commit Message

Shilpasri G Bhat Feb. 28, 2018, 5:35 a.m. UTC
Fast-reboot in P8 fails to re-init OCC data as there are chipwise OCC
nodes which are already present in the /ibm,opal/power-mgt node. These
per-chip nodes hold the voltage IDs for each pstate and these can be
changed on OCC pstate table biasing. So delete these before calling
the re-init code to re-parse and populate the pstate data.

Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
---
 hw/occ.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Stewart Smith March 1, 2018, 4:08 a.m. UTC | #1
Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> writes:
> Fast-reboot in P8 fails to re-init OCC data as there are chipwise OCC
> nodes which are already present in the /ibm,opal/power-mgt node. These
> per-chip nodes hold the voltage IDs for each pstate and these can be
> changed on OCC pstate table biasing. So delete these before calling
> the re-init code to re-parse and populate the pstate data.
>
> Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
> ---
>  hw/occ.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Ahh, thanks for that. Merged to master as of ac4272bf5e73de78bfb4cdffac8f57222b059f72
diff mbox series

Patch

diff --git a/hw/occ.c b/hw/occ.c
index 3e92b9a..37cf73c 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -1664,7 +1664,7 @@  void occ_pstates_init(void)
 		return;
 	/* Handle fast reboots */
 	if (occ_pstates_initialized) {
-		struct dt_node *power_mgt;
+		struct dt_node *power_mgt, *child;
 		int i;
 		const char *props[] = {
 				"ibm,pstate-core-max",
@@ -1682,6 +1682,10 @@  void occ_pstates_init(void)
 		power_mgt = dt_find_by_path(dt_root, "/ibm,opal/power-mgt");
 		for (i = 0; i < ARRAY_SIZE(props); i++)
 			dt_check_del_prop(power_mgt, props[i]);
+
+		dt_for_each_child(power_mgt, child)
+			if (!strncmp(child->name, "occ", 3))
+				dt_free(child);
 	}
 
 	switch (proc_gen) {