[PATCH v2] powerpc/papr_scm: Reduce error severity if nvdimm stats inaccessible

Vaibhav Jain vaibhav at linux.ibm.com
Fri May 7 22:18:39 AEST 2021

Hi Ira,

Thanks for looking into this patch

Ira Weiny <ira.weiny at intel.com> writes:

> On Thu, May 06, 2021 at 12:46:06AM +0530, Vaibhav Jain wrote:
>> Currently drc_pmem_qeury_stats() generates a dev_err in case
>> "Enable Performance Information Collection" feature is disabled from
>> HMC or performance stats are not available for an nvdimm. The error is
>> of the form below:
>> papr_scm ibm,persistent-memory:ibm,pmemory at 44104001: Failed to query
>> 	 performance stats, Err:-10
>> This error message confuses users as it implies a possible problem
>> with the nvdimm even though its due to a disabled/unavailable
>> feature. We fix this by explicitly handling the H_AUTHORITY and
>> In case of H_AUTHORITY error an info message is logged instead of an
>> error, saying that "Permission denied while accessing performance
>> stats". Also '-EACCES' error is return instead of -EPERM.
> I thought you clarified before that this was a permission issue.  So why change
> the error to EACCES?
EACCESS("Permission Denied") felt like a more accurate error code for
this case than EPERM("Operation not permitted"). So switched the usage
of EPERM error code to handle the case if this hcall is not supported
for an nvdimm.

>> In case of H_UNSUPPORTED error we return a -EPERM error back from
>> drc_pmem_query_stats() indicating that performance stats-query
>> operation is not supported on this nvdimm.
> EPERM seems wrong here too...  ENOTSUP?
Yes, will change it to EOPNOTSUPP in v3.

> Ira
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm at lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave at lists.01.org

~ Vaibhav

More information about the Linuxppc-dev mailing list