[Skiboot] [PATCH] hw/imc: Check for pause_microcode_at_boot() return status
Anju T Sudhakar
anju at linux.vnet.ibm.com
Mon Apr 9 20:33:27 AEST 2018
On Monday 09 April 2018 10:30 AM, Madhavan Srinivasan wrote:
> 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 at linux.vnet.ibm.com>
> ---
> hw/imc.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/hw/imc.c b/hw/imc.c
> index a56f33677096..c567429ec5f4 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
Tested-by : Anju T Sudhakar <anju at linux.vnet.ibm.com>
Regards,
Anju
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/skiboot/attachments/20180409/4b84e0e8/attachment.html>
More information about the Skiboot
mailing list