[Skiboot] [PATCH] xscom: Fix xscom error logging caused due to xscom OPAL call

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Mon Oct 19 21:49:42 AEDT 2020


On 10/1/20 11:03 PM, Gautham R. Shenoy wrote:
> From: "Gautham R. Shenoy" <ego at linux.vnet.ibm.com>
> 
> Commit 80fd2e963bd4 ("xscom: Don't log xscom errors caused by OPAL
> calls") ensured that xscom errors caused due to XSCOM
> read/write OPAL calls aren't logged in the error-log since the caller
> of the OPAL call is expected to handle it.
> 
> However we are continuing to print the prerror() in the OPAL log
> regarding the same. This patch ensures that we do not log these errors
> in the OPAL-log as well.
> 
> Tested-by: Pavaman Subramaniyam <pavsubra at in.ibm.com>
> Signed-off-by: Gautham R. Shenoy <ego at linux.vnet.ibm.com>
> ---
>   hw/xscom.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/xscom.c b/hw/xscom.c
> index 0eda567..518a415 100644
> --- a/hw/xscom.c
> +++ b/hw/xscom.c
> @@ -373,7 +373,14 @@ static int __xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val)
>   	if (proc_gen == proc_gen_p9 && ret == OPAL_XSCOM_CHIPLET_OFF)
>   		return ret;
> 
> -	prerror("XSCOM: Read failed, ret =  %lld\n", ret);
> +	/*
> +	 * If we're in an XSCOM opal call then opal-prd will handle
> +	 * logging the error. If not, log it.
> +	 */
> +	if (this_cpu()->current_token != OPAL_XSCOM_READ &&
> +	    this_cpu()->current_token != OPAL_XSCOM_WRITE)

Why do you want to check XSCOM_WRITE in xscom_read API call?

Also fix xscom_write() API call as well?

-Vasant


> +		prerror("XSCOM: Read failed, ret =  %lld\n", ret);
> +
>   	return ret;
>   }
> 



More information about the Skiboot mailing list