summaryrefslogtreecommitdiffstats
path: root/hw
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-10 15:38:29 +1000
commitafc89188010b4b33c78357eb9af1064690d324cb (patch)
treeaec4190c0a7157f80c8077d47767ca9d318f2e91 /hw
parentdec7fe284b8b9169b89d05196d08d550b911acd6 (diff)
downloadtalos-skiboot-afc89188010b4b33c78357eb9af1064690d324cb.tar.gz
talos-skiboot-afc89188010b4b33c78357eb9af1064690d324cb.zip
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/imc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/imc.c b/hw/imc.c
index a56f3367..c567429e 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -164,7 +164,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;
@@ -173,7 +173,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;
}
/*
@@ -606,7 +610,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
OpenPOWER on IntegriCloud