hw/imc: Add error message on failing cases for imc_init
diff mbox series

Message ID 20200319083915.18082-1-anju@linux.vnet.ibm.com
State Accepted
Headers show
Series
  • hw/imc: Add error message on failing cases for imc_init
Related show

Checks

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

Commit Message

Anju T Sudhakar March 19, 2020, 8:39 a.m. UTC
From: Madhavan Srinivasan <maddy@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@linux.ibm.com>
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
---
 hw/imc.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

--
2.20.1

Comments

Oliver O'Halloran April 1, 2020, 4:34 a.m. UTC | #1
On Thu, Mar 19, 2020 at 7:39 PM Anju T Sudhakar <anju@linux.vnet.ibm.com> wrote:
>
> From: Madhavan Srinivasan <maddy@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@linux.ibm.com>
> Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
> ---

Thanks, merged as 3794167200e7

Patch
diff mbox series

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;
 	}