linux/arch/powerpc/platforms/pseries
Vaibhav Jain ca78ef2f08 powerpc/papr_scm: Fix warning triggered by perf_stats_show()
A warning is reported by the kernel in case perf_stats_show() returns
an error code. The warning is of the form below:

 papr_scm ibm,persistent-memory:ibm,pmemory@44100001:
 	  Failed to query performance stats, Err:-10
 dev_attr_show: perf_stats_show+0x0/0x1c0 [papr_scm] returned bad count
 fill_read_buffer: dev_attr_show+0x0/0xb0 returned bad count

On investigation it looks like that the compiler is silently
truncating the return value of drc_pmem_query_stats() from 'long' to
'int', since the variable used to store the return code 'rc' is an
'int'. This truncated value is then returned back as a 'ssize_t' back
from perf_stats_show() to 'dev_attr_show()' which thinks of it as a
large unsigned number and triggers this warning..

To fix this we update the type of variable 'rc' from 'int' to
'ssize_t' that prevents the compiler from truncating the return value
of drc_pmem_query_stats() and returning correct signed value back from
perf_stats_show().

Fixes: 2d02bf835e ("powerpc/papr_scm: Fetch nvdimm performance stats from PHYP")
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200912081451.66225-1-vaibhav@linux.ibm.com
2020-09-16 22:05:03 +10:00
..
cmm.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
dlpar.c powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
dtl.c powerpc64: Break asm/percpu.h vs spinlock_types.h dependency 2020-07-10 12:00:01 +02:00
eeh_pseries.c powerpc/pseries/eeh: Fix dumb linebreaks 2020-09-08 22:23:42 +10:00
event_sources.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
firmware.c powerpc/book3s64/radix: Add kernel command line option to disable radix GTSE 2020-07-29 21:09:37 +10:00
hotplug-cpu.c powerpc/pseries/hotplug-cpu: wait indefinitely for vCPU death 2020-08-18 17:09:52 +10:00
hotplug-memory.c pseries/drmem: don't cache node id in drmem_lmb struct 2020-09-02 11:00:21 +10:00
hvCall_inst.c powerpc: pseries: no need to check return value of debugfs_create functions 2019-11-02 18:09:10 +01:00
hvCall.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
hvconsole.c powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
hvcserver.c powerpc: Use fallthrough pseudo-keyword 2020-07-29 21:09:37 +10:00
ibmebus.c powerpc/pseries: Make vio and ibmebus initcalls pseries specific 2020-06-02 22:21:31 +10:00
io_event_irq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
iommu.c powerpc/pseries/iommu: Allow bigger 64bit window by removing default DMA window 2020-09-08 22:57:11 +10:00
Kconfig powerpc/pseries: Implement paravirt qspinlocks for SPLPAR 2020-07-27 00:01:29 +10:00
kexec.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
lpar.c powerpc updates for 5.9 2020-08-07 10:33:50 -07:00
lparcfg.c powerpc/pseries: new lparcfg key/value pair: partition_affinity_score 2020-09-02 11:00:20 +10:00
Makefile powerpc/pseries/Makefile: Remove CONFIG_PPC_PSERIES check 2020-02-19 21:07:08 +11:00
mobility.c powerpc/pseries/mobility: Add pr_debug() for device tree changes 2020-07-30 22:53:49 +10:00
msi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
nvram.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
of_helpers.c powerpc/pseries: Fix of_read_drc_info_cell() to point at next record 2020-03-25 12:06:43 +11:00
of_helpers.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
papr_scm.c powerpc/papr_scm: Fix warning triggered by perf_stats_show() 2020-09-16 22:05:03 +10:00
pci_dlpar.c powerpc/eeh: Remove eeh_dev_phb_init_dynamic() 2020-07-26 23:34:19 +10:00
pci.c powerpc/pcidn: Make VF pci_dn management CONFIG_PCI_IOV specific 2020-01-23 21:31:19 +11:00
pmem.c powerpc/pseries: remove cede offline state for CPUs 2020-07-16 13:12:34 +10:00
power.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 167 2019-05-30 11:26:39 -07:00
pseries_energy.c powerpc/pseries: Fix drc-info mappings of logical cpus to drc-index 2019-11-13 16:57:57 +11:00
pseries.h powerpc/pseries: Read TLB Block Invalidate Characteristics 2019-09-24 19:58:42 +10:00
ras.c powerpc/pseries: Do not initiate shutdown when system is running on UPS 2020-08-20 22:55:54 +10:00
reconfig.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
rng.c powerpc/pseries: Fix missing of_node_put() in rng_init() 2020-08-25 01:31:31 +10:00
rtas-fadump.c powerpc: Replace _ALIGN_DOWN() by ALIGN_DOWN() 2020-05-11 23:15:15 +10:00
rtas-fadump.h powerpc/fadump: support holes in kernel boot memory area 2019-09-14 00:04:46 +10:00
scanlog.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
setup.c powerpc updates for 5.9 2020-08-07 10:33:50 -07:00
smp.c powerpc/pseries: Add KVM guest doorbell restrictions 2020-07-29 21:02:10 +10:00
suspend.c powerpc/numa: remove start/stop_topology_update() 2020-07-16 13:12:38 +10:00
svm.c powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory 2020-09-14 23:07:14 +10:00
vio.c powerpc/pseries: Make vio and ibmebus initcalls pseries specific 2020-06-02 22:21:31 +10:00
vphn.c powerpc/vphn: Check for error from hcall_vphn 2020-03-04 22:44:30 +11:00