[Skiboot] [PATCH] hw/npu2-opencapi: Fix setting of supported OpenCAPI templates

Frederic Barrat fbarrat at linux.ibm.com
Wed Sep 12 01:58:50 AEST 2018



Le 11/09/2018 à 03:07, Andrew Donnellan a écrit :
> In opal_npu_tl_set(), we made a typo that means the OPAL_NPU_TL_SET call
> may not clear the enable bits for templates that were previously enabled
> but are now disabled.
> 
> Fix the typo so we clear NPU2_OTL_CONFIG1_TX_TEMP2_EN as well as
> TEMP{1,3}_EN.
> 
> Reported-by: Tyler Seredynski <tseredynski at gmail.com>
> Fixes: cd8b82a8e83ed ("npu2-opencapi: Add OpenCAPI OPAL API calls")
> Cc: stable
> Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
> ---
>   hw/npu2-opencapi.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
> index 57c2f2fcc075..4d30aa6f5fba 100644
> --- a/hw/npu2-opencapi.c
> +++ b/hw/npu2-opencapi.c
> @@ -2007,8 +2007,8 @@ static int64_t opal_npu_tl_set(uint64_t phb_id, uint32_t __unused bdfn,
>   	reg = npu2_scom_read(dev->npu->chip_id, dev->npu->xscom_base,
>   			     NPU2_OTL_CONFIG1(stack, block),
>   			     NPU2_MISC_DA_LEN_8B);
> -	reg &= ~(NPU2_OTL_CONFIG1_TX_TEMP1_EN | NPU2_OTL_CONFIG1_TX_TEMP3_EN |
> -		 NPU2_OTL_CONFIG1_TX_TEMP1_EN);
> +	reg &= ~(NPU2_OTL_CONFIG1_TX_TEMP1_EN | NPU2_OTL_CONFIG1_TX_TEMP2_EN |
> +		 NPU2_OTL_CONFIG1_TX_TEMP3_EN);

Typos always look silly, but that one defies any logic. I'm wondering 
who wrote it.

It appears the TL we've been using support templates 0->3, so we've been 
lucky, no harm done.

Reviewed-by: Frederic Barrat <fbarrat at linux.ibm.com>


   Fred


>   	for (i = 0; i < 4; i++) {
>   		/* Skip template 0 as it is implicitly enabled */
>   		if (i && is_template_supported(i, capabilities))
> 



More information about the Skiboot mailing list