diff mbox series

[2/2] hw/imc: Disable only nest_imc devices if pause_microcode() fails

Message ID 20200929115713.1082952-2-maddy@linux.ibm.com
State Accepted
Headers show
Series [1/2] hw/imc: move imc_init() towards end main_cpu_entry() | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (d362ae4f4c521a7faffb1befe2fbba467f2c4d18)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Madhavan Srinivasan Sept. 29, 2020, 11:57 a.m. UTC
During opal boot, in imc_init(), 24x7/IMC microcode state is checked
and if it is not in running or pause state, currently all the
imc devices are removed from device tree. Instead, remove only
the nest imc devices. Core/Thread/Trace imc devices are not related
to 24x7 microcode. Patch adds a function to remove specific imc
device type and the same is used, when pause_microcode() fails, to
remove nest imc device types from the device tree.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
 hw/imc.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/imc.c b/hw/imc.c
index 63488b9b..c186da04 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -411,6 +411,20 @@  static void disable_unavailable_units(struct dt_node *dev)
 	return;
 }
 
+static void disable_imc_type_from_dt(struct dt_node *dev, int imc_type)
+{
+	struct dt_node *node;
+
+	dt_for_each_compatible(dev, node, "ibm,imc-counters") {
+		if (get_imc_device_type(node) == imc_type) {
+			dt_free(node);
+			node = NULL;
+		}
+	}
+
+	return;
+}
+
 /*
  * Function to queue the loading of imc catalog data
  * from the IMC pnor partition.
@@ -606,8 +620,8 @@  imc_mambo:
 	 * undesirable values. Hence pause the ucode if it is already running.
 	 */
 	if (pause_microcode_at_boot()) {
-		prerror("IMC: Pausing ucode failed\n");
-		goto err;
+		prerror("IMC: Pausing ucode failed, disabling nest imc\n");
+		disable_imc_type_from_dt(dev, IMC_COUNTER_CHIP);
 	}
 
 	/*