[Skiboot] [PATCH] hw/imc: Add error message on failing cases for imc_init

Anju T Sudhakar anju at linux.vnet.ibm.com
Thu Mar 19 19:39:15 AEDT 2020


From: Madhavan Srinivasan <maddy at linux.ibm.com>

Add couple of more debug messages to understand possible fail in
imc_init(). Currently the only message printed is "IMC Devices not added"
which is not very helpful when debugging.

Signed-off-by: Madhavan Srinivasan <maddy at linux.ibm.com>
Signed-off-by: Anju T Sudhakar <anju at linux.vnet.ibm.com>
---
 hw/imc.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/hw/imc.c b/hw/imc.c
index 08d94011..927fba0b 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -544,8 +544,10 @@ void imc_init(void)
 		return;

 	wait_xz_decompress(imc_xz);
-	if (imc_xz->status != OPAL_SUCCESS)
+	if (imc_xz->status != OPAL_SUCCESS) {
+		prerror("IMC: xz_decompress failed\n");
 		goto err;
+	}

 	/*
 	 * Flow of the data from PNOR to main device tree:
@@ -559,8 +561,10 @@ void imc_init(void)

 	/* Create a device tree entry for imc counters */
 	dev = dt_new_root("imc-counters");
-	if (!dev)
+	if (!dev) {
+		prerror("IMC: Failed to add an imc-counters root node\n");
 		goto err;
+	}

 	/*
 	 * Attach the new decompress_buf to the imc-counters node.
@@ -568,6 +572,7 @@ void imc_init(void)
 	 */
 	if (dt_expand_node(dev, imc_xz->dst, 0) < 0) {
 		dt_free(dev);
+		prerror("IMC: dt_expand_node failed\n");
 		goto err;
 	}

@@ -600,8 +605,10 @@ imc_mambo:
 	 * then out to band tools will race with ucode and end up getting
 	 * undesirable values. Hence pause the ucode if it is already running.
 	 */
-	if (pause_microcode_at_boot())
+	if (pause_microcode_at_boot()) {
+		prerror("IMC: Pausing ucode failed\n");
 		goto err;
+	}

 	/*
 	 * If the dt_attach_root() fails, "imc-counters" node will not be
@@ -610,6 +617,7 @@ imc_mambo:
 	 */
 	if (!dt_attach_root(dt_root, dev)) {
 		dt_free(dev);
+		prerror("IMC: Failed to attach imc-counter node to dt root\n");
 		goto err;
 	}

--
2.20.1



More information about the Skiboot mailing list