From: Vaibhav Jain <vaibhav(a)linux.ibm.com>
Sent: Friday, May 29, 2020 3:06 PM
Cc: Vaibhav Jain <vaibhav(a)linux.ibm.com>; Williams, Dan J
<dan.j.williams(a)intel.com>; Verma, Vishal L <vishal.l.verma(a)intel.com>;
Aneesh Kumar K . V <aneesh.kumar(a)linux.ibm.com>; Jeff Moyer
<jmoyer(a)redhat.com>; Oliver O'Halloran <oohall(a)gmail.com>; Santosh
Sivaraj <santosh(a)fossix.org>; Weiny, Ira <ira.weiny(a)intel.com>
Subject: [ndctl PATCH v5 6/6] libndctl,papr_scm: Implement support for
Add support for reporting DIMM health and shutdown state by issuing
PAPR_PDSM_HEALTH request to papr_scm module. It returns an instance of
'struct nd_papr_pdsm_health' as defined in 'papr_pdsm.h'. The patch
provides support for dimm-ops 'new_smart', 'smart_get_health' &
'smart_get_shutdown_state' as newly introduced functions
papr_new_smart_health(), papr_smart_get_health() &
papr_smart_get_shutdown_state() respectively. These callbacks should
enable ndctl to report DIMM health.
Also a new member 'struct dimm_priv.health' is introduced which holds the
current health status of the dimm. This member is set inside newly added
function 'update_dimm_health_v1()' which parses the v1 payload returned
by the kernel after servicing PAPR_PDSM_HEALTH. The function will also
update dimm-flags viz 'struct ndctl_dimm.flags.f_*'
based on the flags set in the returned payload.
Signed-off-by: Vaibhav Jain <vaibhav(a)linux.ibm.com>
* Updated patch description to reflect updated names of struct and
defines that have the term 'scm' removed.
* Squashed patch to report nvdimm bad shutdown state with this patch.
* Switched to new structs/enums as defined in papr_scm_pdsm.h
ndctl/lib/papr.c | 90
1 file changed, 87 insertions(+), 3 deletions(-)
diff --git a/ndctl/lib/papr.c b/ndctl/lib/papr.c index
@@ -42,7 +42,9 @@
/* Per dimm data. Holds per-dimm data parsed from the cmd_pkgs */ struct
- /* Empty for now */
+ /* Cache the dimm health status */
+ struct nd_papr_pdsm_health health;
I don't understand this. The kernel is caching this, why does libndctl need to cache