aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>2018-04-09 10:30:44 +0530
committerStewart Smith <stewart@linux.ibm.com>2018-04-12 15:33:17 +1000
commit129e7bc355341cba6c301ed412b3364482ce027a (patch)
treede434412de834d28e0873012424fa0f299057245
parentecadbe689b689216553c12fa91b3b9b0296653b1 (diff)
downloadskiboot-129e7bc355341cba6c301ed412b3364482ce027a.zip
skiboot-129e7bc355341cba6c301ed412b3364482ce027a.tar.gz
skiboot-129e7bc355341cba6c301ed412b3364482ce027a.tar.bz2
hw/imc: Check for pause_microcode_at_boot() return status
pause_microcode_at_boot() loops through all the chip's ucode control block and pause the ucode if it is in the running state. But it does not fail if any of the chip's ucode is not initialised. Add code to return a failure if ucode is not initialized in any of the chip. Since pause_microcode_at_boot() is called just before attaching the IMC device nodes in imc_init(), add code to check for the function return. Fixes: 9750eee802f8d ('hw/imc: pause microcode at boot') Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com> (cherry picked from commit afc89188010b4b33c78357eb9af1064690d324cb) Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--hw/imc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/imc.c b/hw/imc.c
index 5bc59b5..4a6847f 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -161,7 +161,7 @@ static struct imc_chip_cb *get_imc_cb(uint32_t chip_id)
return cb;
}
-static void pause_microcode_at_boot(void)
+static int pause_microcode_at_boot(void)
{
struct proc_chip *chip;
struct imc_chip_cb *cb;
@@ -170,7 +170,11 @@ static void pause_microcode_at_boot(void)
cb = get_imc_cb(chip->id);
if (cb)
cb->imc_chip_command = cpu_to_be64(NEST_IMC_DISABLE);
+ else
+ return -1; /* ucode is not init-ed */
}
+
+ return 0;
}
/*
@@ -603,7 +607,8 @@ 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.
*/
- pause_microcode_at_boot();
+ if (pause_microcode_at_boot())
+ goto err;
/*
* If the dt_attach_root() fails, "imc-counters" node will not be