Subject: Re: [PATCH 2/8] powerpc/papr_scm: Provide support for fetching dimm health information

From: "Aneesh Kumar K.V" <[email-masked]>
Date: Mon, 09 Mar 2020 15:54:18 +0530

Vaibhav Jain <[email-masked]> writes:

> Implement support for fetching dimm health information via
> H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair of
> 64-bit big-endian integers which are then stored in 'struct
> papr_scm_priv' and subsequently exposed to userspace via dimm
> attribute 'papr_flags'.

Can you  add this as part of PATCH 1. While reviewing i had to go back
and forth between 1 and 2 to find different flags. IMHO it would be nice
to introduce new flags and users of the flag together. 
>
> 'papr_flags' sysfs attribute reports space separated string flags
> indicating various health state an nvdimm can be. These are:
>
> * "not_armed" 	: Indicating that nvdimm contents wont survive a power
>   		  cycle.
> * "save_fail" 	: Indicating that nvdimm contents couldn't be flushed
> 		  during last shutdown event.
> * "restore_fail": Indicating that nvdimm contents couldn't be restored
> 		  during dimm initialization.
> * "encrypted" 	: Dimm contents are encrypted.
> * "smart_notify": There is health event for the nvdimm.

Can you explain this more? This is suppose to be set when there is a
smart event? Currently you derive this based on

+/* Bit status indicators for smart event notification */
+#define PAPR_SCM_DIMM_SMART_EVENT_MASK (PAPR_SCM_DIMM_HEALTH_CRITICAL | \
+					   PAPR_SCM_DIMM_HEALTH_FATAL | \
+					   PAPR_SCM_DIMM_HEALTH_UNHEALTHY | \
+

> * "scrubbed" 	: Indicating that contents of the nvdimm have been
>   		  scrubbed.
> * "locked"	: Indicating that nvdimm contents cant be modified
>   		  until next power cycle.
>
> [1]: commit 58b278f568f0 ("powerpc: Provide initial documentation for
> PAPR hcalls")
>

-aneesh