diff mbox series

xscom: Fix xscom error logging caused due to xscom OPAL call

Message ID 1601573627-31054-1-git-send-email-ego@linux.vnet.ibm.com
State Changes Requested
Headers show
Series xscom: Fix xscom error logging caused due to xscom OPAL call | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (f76a1d963ca26ec9925a1aaf126c8cf70de67224)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Gautham R Shenoy Oct. 1, 2020, 5:33 p.m. UTC
From: "Gautham R. Shenoy" <ego@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@in.ibm.com>
Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
---
 hw/xscom.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Vasant Hegde Oct. 19, 2020, 10:49 a.m. UTC | #1
On 10/1/20 11:03 PM, Gautham R. Shenoy wrote:
> From: "Gautham R. Shenoy" <ego@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@in.ibm.com>
> Signed-off-by: Gautham R. Shenoy <ego@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;
>   }
>
Gautham R Shenoy Oct. 22, 2020, 4:56 a.m. UTC | #2
Hello Vasant,

On Mon, Oct 19, 2020 at 04:19:42PM +0530, Vasant Hegde wrote:
> On 10/1/20 11:03 PM, Gautham R. Shenoy wrote:
> >From: "Gautham R. Shenoy" <ego@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@in.ibm.com>
> >Signed-off-by: Gautham R. Shenoy <ego@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?

My bad. I used the condition from the earlier patch. Will split this
into XSCOM_READ and XSCOM_WRITE checks in the xscom_read() and
xscom_write() APIs.


> 
> Also fix xscom_write() API call as well?
> 
> -Vasant


--
Thanks and Regards
gautham.
> 
> 
> >+		prerror("XSCOM: Read failed, ret =  %lld\n", ret);
> >+
> >  	return ret;
> >  }
> >
>
diff mbox series

Patch

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)
+		prerror("XSCOM: Read failed, ret =  %lld\n", ret);
+
 	return ret;
 }