]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/papr_scm: Fix nvdimm event mappings
authorKajol Jain <kjain@linux.ibm.com>
Thu, 4 Aug 2022 07:48:52 +0000 (13:18 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 23 Aug 2022 01:44:36 +0000 (11:44 +1000)
commitc67b37bbd75277c73601c945bd65f7c237e94500
treee41f9677a3a99dae9ec9311e3f39c1cddf77b14a
parentab10ff5e8831a0b67cd316b656c1de8c860c2d7c
powerpc/papr_scm: Fix nvdimm event mappings

Commit 47b6f0f87f11 ("powerpc/papr_scm: Add perf interface support")
added performance monitoring support for papr-scm nvdimm devices via
perf interface. Commit also added an array in papr_scm_priv
structure called "nvdimm_events_map", which got filled based on the
result of H_SCM_PERFORMANCE_STATS hcall.

Currently there is an assumption that the order of events in the
stats buffer, returned by the hypervisor is same. And order also
happens to matches with the events specified in nvdimm driver code.
But this assumption is not documented in Power Architecture
Platform Requirements (PAPR) document. Although the order
of events happens to be same on current generation od system, but
it might not be true in future generation systems. Fix the issue, by
adding a static mapping for nvdimm events to corresponding stat-id,
and removing the dynamic map from papr_scm_priv structure. Also
remove the function papr_scm_pmu_check_events from papr_scm.c file,
as we no longer need to copy stat-ids dynamically.

Fixes: 47b6f0f87f11 ("powerpc/papr_scm: Add perf interface support")
Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Reviewed-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220804074852.55157-1-kjain@linux.ibm.com
arch/powerpc/platforms/pseries/papr_scm.c