[RFC PATCH 0/4] powerpc/papr_scm: Add support for reporting NVDIMM performance statistics

2020-05-18 Thread Vaibhav Jain
sued by libndctl to read values of a specific NVDIMM performance stat like "Life Remaining". References == [1] Documentation/powerpc/papr_hcals.rst [2] https://lore.kernel.org/linux-nvdimm/20200508104922.72565-1-vaib...@linux.ibm.com/ [3] https://github.com/vaibhav92/ndctl/tree/p

[RFC PATCH 1/4] powerpc/papr_scm: Fetch nvdimm performance stats from PHYP

2020-05-18 Thread Vaibhav Jain
length in two newly introduced NVDIMM private struct members 'perf_stats' and 'len_stat_buffer'. Signed-off-by: Vaibhav Jain --- Documentation/ABI/testing/sysfs-bus-papr-scm | 27 arch/powerpc/platforms/pseries/papr_scm.c| 156 +++ 2 files changed, 1

Re: [PATCH v2] papr/scm: Add bad memory ranges to nvdimm bad ranges

2020-05-10 Thread Vaibhav Jain
Hi Santosh, Thanks for the updated patch. Minor review comment below: Santosh Sivaraj writes: > Subscribe to the MCE notification and add the physical address which > generated a memory error to nvdimm bad range. > > Reviewed-by: Mahesh Salgaonkar > Signed-off-by: Santosh Sivaraj > --- > arc

Re: [PATCH v7 2/5] seq_buf: Export seq_buf_printf() to external modules

2020-05-10 Thread Vaibhav Jain
Michael Ellerman writes: > Borislav Petkov writes: >> On Fri, May 08, 2020 at 04:19:19PM +0530, Vaibhav Jain wrote: >>> 'seq_buf' provides a very useful abstraction for writing to a string >>> buffer without needing to worry about it over-flowing. However ev

Re: [PATCH v7 2/5] seq_buf: Export seq_buf_printf() to external modules

2020-05-10 Thread Vaibhav Jain
Hi Boris, Borislav Petkov writes: > On Fri, May 08, 2020 at 05:30:31PM +0530, Vaibhav Jain wrote: >> I am referring to Kernel Loadable Modules with MODULE_LICENSE("GPL") >> here. > > And what does "external" refer to? Because if it is out-of-tree,

Re: [PATCH v7 2/5] seq_buf: Export seq_buf_printf() to external modules

2020-05-10 Thread Vaibhav Jain
Hi Joe, Joe Perches writes: > On Fri, 2020-05-08 at 17:30 +0530, Vaibhav Jain wrote: >> Hi Boris, >> >> Borislav Petkov writes: >> >> > On Fri, May 08, 2020 at 04:19:19PM +0530, Vaibhav Jain wrote: >> > > 'seq_buf' provides a ver

Re: [PATCH v7 2/5] seq_buf: Export seq_buf_printf() to external modules

2020-05-08 Thread Vaibhav Jain
Hi Boris, Borislav Petkov writes: > On Fri, May 08, 2020 at 04:19:19PM +0530, Vaibhav Jain wrote: >> 'seq_buf' provides a very useful abstraction for writing to a string >> buffer without needing to worry about it over-flowing. However even >> though the API has

[PATCH v7 5/5] powerpc/papr_scm: Implement support for PAPR_SCM_PDSM_HEALTH

2020-05-08 Thread Vaibhav Jain
ruct nd_papr_pdsm_health' to cache the health information of a nvdimm. As a result functions drc_pmem_query_health() and flags_show() are updated to populate and use this new struct instead of a u64 integer that was earlier used. Cc: Dan Williams Cc: Michael Ellerman Cc: "Aneesh Kumar K .

[PATCH v7 2/5] seq_buf: Export seq_buf_printf() to external modules

2020-05-08 Thread Vaibhav Jain
Cc: Borislav Petkov Signed-off-by: Vaibhav Jain --- Changelog: v6..v7: * New patch in the series --- lib/seq_buf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/seq_buf.c b/lib/seq_buf.c index 4e865d42ab03..707453f5d58e 100644 --- a/lib/seq_buf.c +++ b/lib/seq_buf.c @@ -91,6 +91,7 @@ int s

[PATCH v7 4/5] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-05-08 Thread Vaibhav Jain
from papr_scm_ndctl() in case of a PDSM request is received via ND_CMD_CALL command from libnvdimm. Cc: Dan Williams Cc: Michael Ellerman Cc: "Aneesh Kumar K . V" Signed-off-by: Vaibhav Jain --- Changelog: v6..v7 : * Removed the re-definitions of __packed macro from papr_scm_pdsm.h

[PATCH v7 3/5] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-05-08 Thread Vaibhav Jain
gs' is also introduced at Documentation/ABI/testing/sysfs-bus-papr-scm. [1] commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") Cc: Dan Williams Cc: Michael Ellerman Cc: "Aneesh Kumar K . V" Signed-off-by: Vaibhav Jain --- Changelog: v6..v7 : * Used

[PATCH v7 0/5] powerpc/papr_scm: Add support for reporting nvdimm health

2020-05-08 Thread Vaibhav Jain
s: [1] "Power Architecture Platform Reference" https://en.wikipedia.org/wiki/Power_Architecture_Platform_Reference [2] commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") [3] "Linux on Power Architecture Platform Reference" https://m

[PATCH v7 1/5] powerpc: Document details on H_SCM_HEALTH hcall

2020-05-08 Thread Vaibhav Jain
Add documentation to 'papr_hcalls.rst' describing the bitmap flags that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM specification. Cc: Dan Williams Cc: Michael Ellerman Cc: "Aneesh Kumar K . V" Signed-off-by: Vaibhav Jain --- Changelog: v6..v7: * None v5..v

Re: [PATCH v6 1/4] powerpc: Document details on H_SCM_HEALTH hcall

2020-05-04 Thread Vaibhav Jain
Thanks for looking into this patch Mpe, Michael Ellerman writes: > Vaibhav Jain writes: > >> Add documentation to 'papr_hcalls.rst' describing the bitmap flags >> that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM >> specification. >> >

Re: [PATCH v6 3/4] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-04-30 Thread Vaibhav Jain
Hi Mpe, Thanks again for reviewing this patchset. Michael Ellerman writes: > Vaibhav Jain writes: >> Introduce support for Papr nvDimm Specific Methods (PDSM) in papr_scm >> modules and add the command family to the white list of NVDIMM command >> sets. Also advertise su

Re: [PATCH v5 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-04-20 Thread Vaibhav Jain
-nvdimm/20200420070711.223545-1-vaib...@linux.ibm.com Thanks, ~ Vaibhav Jain Dan Williams writes: > On Tue, Mar 31, 2020 at 7:33 AM Vaibhav Jain wrote: >> >> This patch implements support for papr_scm command >> 'DSM_PAPR_SCM_HEALTH' that ret

[PATCH v6 4/4] powerpc/papr_scm: Implement support for PAPR_SCM_PDSM_HEALTH

2020-04-20 Thread Vaibhav Jain
ruct nd_papr_pdsm_health' to cache the health information of a nvdimm. As a result functions drc_pmem_query_health() and flags_show() are updated to populate and use this new struct instead of a u64 integer that was earlier used. Cc: Dan Williams Cc: Michael Ellerman Cc: "Aneesh Kumar K .

[PATCH v6 3/4] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-04-20 Thread Vaibhav Jain
from papr_scm_ndctl() in case of a PDSM request is received via ND_CMD_CALL command from libnvdimm. Cc: Dan Williams Cc: Michael Ellerman Cc: "Aneesh Kumar K . V" Signed-off-by: Vaibhav Jain --- Changelog v5..v6 : * Changed the usage of the term DSM to PDSM to distinguish it from

[PATCH v6 1/4] powerpc: Document details on H_SCM_HEALTH hcall

2020-04-20 Thread Vaibhav Jain
Add documentation to 'papr_hcalls.rst' describing the bitmap flags that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM specification. Cc: Dan Williams Cc: Michael Ellerman Cc: "Aneesh Kumar K . V" Signed-off-by: Vaibhav Jain --- Changelog: v5..v6 * New

[PATCH v6 2/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-20 Thread Vaibhav Jain
documentation text describing flags reported by the the new sysfs attribute 'papr/flags' is also introduced at Documentation/ABI/testing/sysfs-bus-papr-scm. [1] commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") Cc: Dan Williams Cc: Michael Ellerman

[PATCH v6 0/4] powerpc/papr_scm: Add support for reporting nvdimm health

2020-04-20 Thread Vaibhav Jain
rsion of the structure is currently in existence. References: [1] "Power Architecture Platform Reference" https://en.wikipedia.org/wiki/Power_Architecture_Platform_Reference [2] commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") [3] "Linux o

Re: [PATCH] papr/scm: Add bad memory ranges to nvdimm bad ranges

2020-04-15 Thread Vaibhav Jain
river papr_scm_driver = { > }, > }; > > -module_platform_driver(papr_scm_driver); > +static int __init papr_scm_init(void) > +{ > + int ret; > + > + ret = platform_driver_register(&papr_scm_driver); > + if (!ret) > + mce_register_notifier(&mce_ue_nb); > + > + return ret; > +} > +module_init(papr_scm_init); > + > +static void __exit papr_scm_exit(void) > +{ > + mce_unregister_notifier(&mce_ue_nb); > + platform_driver_unregister(&papr_scm_driver); > +} > +module_exit(papr_scm_exit); > + > MODULE_DEVICE_TABLE(of, papr_scm_match); > MODULE_LICENSE("GPL"); > MODULE_AUTHOR("IBM Corporation"); > -- > 2.25.1 > -- Vaibhav Jain Linux Technology Center, IBM India Pvt. Ltd.

Re: [PATCH kernel] powerpc/pseries/ddw: Extend upper limit for huge DMA window for persistent memory

2020-04-03 Thread Vaibhav Jain
; > Since the persistent memory is still backed with page structs, > use MAX_PHYSMEM_BITS as the upper limit. > > This effectively disables huge DMA window in LPAR under pHyp if > persistent memory is present but this is the best we can do. > > Signed-off-by: Alexey Kardashevskiy T

[PATCH v5 3/4] powerpc/papr_scm, uapi: Add support for handling PAPR DSM commands

2020-03-31 Thread Vaibhav Jain
y tests on them. In case of a DSM command being sent via ND_CMD_CALL a newly introduced function papr_scm_service_dsm() is called to handle the request. Signed-off-by: Vaibhav Jain --- Changelog: v4..v5: Fixed a bug in new implementation of papr_scm_ndctl(). v3..v4: Updated papr_scm_ndctl() to

[PATCH v5 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-03-31 Thread Vaibhav Jain
ealth' thats an instance of 'struct nd_papr_scm_dimm_health_stat' to cache the health information of a scm-dimm. As a result functions drc_pmem_query_health() and papr_flags_show() are updated to populate and use this new struct instead of two be64 integers that we earlier used. Signed-off-by: Vaibha

[PATCH v5 2/4] ndctl/uapi: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-03-31 Thread Vaibhav Jain
Add PAPR-scm family of DSM command-set to the white list of NVDIMM command sets. Signed-off-by: Vaibhav Jain --- Changelog: v4..v5 : None v3..v4 : None v2..v3 : Updated the patch prefix to 'ndctl/uapi' [Aneesh] v1..v2 : None --- include/uapi/linux/ndctl.h | 1 + 1 file changed, 1

[PATCH v5 0/4] powerpc/papr_scm: Add support for reporting nvdimm health

2020-03-31 Thread Vaibhav Jain
t 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") [3]: "Linux on Power Architecture Platform Reference" https://members.openpowerfoundation.org/document/dl/469 [4]: https://patchwork.kernel.org/project/linux-nvdimm/list/?series=244625 Vaibhav Jai

[PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-03-31 Thread Vaibhav Jain
dimm 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") Signed-off-by: Vaibhav Jain --- Changelog: v4..v5 : None v

[PATCH v4 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-03-31 Thread Vaibhav Jain
ealth' thats an instance of 'struct nd_papr_scm_dimm_health_stat' to cache the health information of a scm-dimm. As a result functions drc_pmem_query_health() and papr_flags_show() are updated to populate and use this new struct instead of two be64 integers that we earlier used. Signed-off-

[PATCH v4 3/4] powerpc/papr_scm, uapi: Add support for handling PAPR DSM commands

2020-03-31 Thread Vaibhav Jain
y tests on them. In case of a DSM command being sent via ND_CMD_CALL a newly introduced function papr_scm_service_dsm() is called to handle the request. Signed-off-by: Vaibhav Jain --- Changelog: v3..v4: Updated papr_scm_ndctl() to delegate DSM command handling to a different functio

[PATCH v4 2/4] ndctl/uapi: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-03-31 Thread Vaibhav Jain
Add PAPR-scm family of DSM command-set to the white list of NVDIMM command sets. Signed-off-by: Vaibhav Jain --- Changelog: v3..v4 : None v2..v3 : Updated the patch prefix to 'ndctl/uapi' [Aneesh] v1..v2 : None --- include/uapi/linux/ndctl.h | 1 + 1 file changed, 1 insertion(+)

[PATCH v4 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-03-31 Thread Vaibhav Jain
dimm 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") Signed-off-by: Vaibhav Jain --- Changelog: v3..v4 : None

[PATCH v4 0/4] powerpc/papr_scm: Add support for reporting nvdimm health

2020-03-31 Thread Vaibhav Jain
structure is currently in existence. References: [1]: "Power Architecture Platform Reference" https://en.wikipedia.org/wiki/Power_Architecture_Platform_Reference [2]: commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") [3]: "Linux on Power A

[PATCH v3 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-03-30 Thread Vaibhav Jain
ealth' thats an instance of 'struct nd_papr_scm_dimm_health_stat' to cache the health information of a scm-dimm. As a result functions drc_pmem_query_health() and papr_flags_show() are updated to populate and use this new struct instead of two be64 integers that we earlier used. Signed-off-by: Vai

[PATCH v3 3/4] powerpc/papr_scm, uapi: Add support for handling PAPR DSM commands

2020-03-30 Thread Vaibhav Jain
reads the args to papr_scm_ndctl() , performs sanity tests on them and converts them to PAPR DSM commands which can then be handled via the switch-case block. Signed-off-by: Vaibhav Jain --- Changelog: v2..v3: Updated the nd_papr_scm_cmd_pkg to use __xx types as its exported to the userspa

[PATCH v3 2/4] ndctl/uapi: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-03-30 Thread Vaibhav Jain
Add PAPR-scm family of DSM command-set to the white list of NVDIMM command sets. Signed-off-by: Vaibhav Jain --- Changelog: v2..v3 : Updated the patch prefix to 'ndctl/uapi' [Aneesh] v1..v2 : None --- include/uapi/linux/ndctl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/in

[PATCH v3 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-03-30 Thread Vaibhav Jain
dimm 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") Signed-off-by: Vaibhav Jain --- Change-log: v2..v3 : Remove

[PATCH v3 0/4] powerpc/papr_scm: Add support for reporting nvdimm health

2020-03-30 Thread Vaibhav Jain
atform_Reference [2]: commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") [3]: "Linux on Power Architecture Platform Reference" https://members.openpowerfoundation.org/document/dl/469 [4]: https://patchwork.kernel.org/project/linux-nvdimm/list

[PATCH v2 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-03-28 Thread Vaibhav Jain
ealth' thats an instance of 'struct nd_papr_scm_dimm_health_stat' to cache the health information of a scm-dimm. As a result functions drc_pmem_query_health() and papr_flags_show() are updated to populate and use this new struct instead of two be64 integers that we earlier used. Signed-off-by

[PATCH v2 0/4] powerpc/papr_scm: Add support for reporting nvdimm health

2020-03-28 Thread Vaibhav Jain
ce [2]: commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") [3]: "Linux on Power Architecture Platform Reference" https://members.openpowerfoundation.org/document/dl/469 [4]: https://patchwork.kernel.org/project/linux-nvdimm/list/?series=2

[PATCH v2 2/4] UAPI: ndctl: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-03-28 Thread Vaibhav Jain
Add PAPR-scm family of DSM command-set to the white list of NVDIMM command sets. Signed-off-by: Vaibhav Jain --- include/uapi/linux/ndctl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h index de5d90212409..99fb60600ef8 100644 --- a

[PATCH v2 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-03-28 Thread Vaibhav Jain
dimm 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") Signed-off-by: Vaibhav Jain --- arch/powerpc/include/a

[PATCH v2 3/4] powerpc/papr_scm, uapi: Add support for handling PAPR DSM commands

2020-03-28 Thread Vaibhav Jain
reads the args to papr_scm_ndctl() , performs sanity tests on them and converts them to PAPR DSM commands which can then be handled via the switch-case block. Signed-off-by: Vaibhav Jain --- arch/powerpc/include/uapi/asm/papr_scm_dsm.h | 161 +++ arch/powerpc/platforms/pseries/

[PATCH] pseries/iommu: Tweak ddw behavior in presence of pmem

2020-03-10 Thread Vaibhav Jain
DW always 'No' : Force enable DDW even if Pmem nodes present in device-tree Signed-off-by: Vaibhav Jain --- .../admin-guide/kernel-parameters.txt | 10 ++- arch/powerpc/platforms/pseries/iommu.c| 67 +-- 2 files changed, 70 insertions(+), 7 deletions(-)

[PATCH 5/8] powerpc/uapi: Introduce uapi header 'papr_scm_dsm.h' for papr_scm DSMs

2020-02-20 Thread Vaibhav Jain
attributes. 2. If an entity (libndctl or papr_scm) supports a DSM struct T(X) then it should also support T(1), T(2)...T(X - 1). i.e When adding support for new version of a DSM struct, libndctl and papr_scm should retain support of the existing DSM struct version they support. Signed-

[PATCH 8/8] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-02-20 Thread Vaibhav Jain
ntain appropriate version information in 'struct nd_papr_scm_cmd_pkg.payload_version'. The patch takes care of only returning the sub-data corresponding to the payload version requested. Please see the comments in papr_scm_get_health() for how this is done. Signed-off-by: Vaibhav Jain -

[PATCH 7/8] powerpc/papr_scm: Re-implement 'papr_flags' using 'nd_papr_scm_dimm_health_stat'

2020-02-20 Thread Vaibhav Jain
e flags in 'struct papr_scm_priv.health' to return appropriate status strings pertaining to dimm health. This patch shouldn't introduce any behavioral change. Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 61 --- 1 file changed, 44 insertions

[PATCH 6/8] powerpc/papr_scm: Add support for handling PAPR DSM commands

2020-02-20 Thread Vaibhav Jain
) , performs sanity tests on them and converts them to PAPR DSM commands which can then be handled via the switch-case block. Signed-off-by: Vaibhav Jain --- Change-log: * Added a 'reserved' field in 'struct nd_pkg_papr_scm' to ensure 'payload' falls on a 8-Byte a

[PATCH 4/8] UAPI: ndctl: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-02-20 Thread Vaibhav Jain
Add PAPR-scm family of DSM command-set to the white list of NVDIMM command sets. Signed-off-by: Vaibhav Jain --- include/uapi/linux/ndctl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h index de5d90212409..99fb60600ef8 100644 --- a

[PATCH 3/8] powerpc/papr_scm: Fetch dimm performance stats from PHYP

2020-02-20 Thread Vaibhav Jain
278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 107 ++ 1 file changed, 107 insertions(+) diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platform

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

2020-02-20 Thread Vaibhav Jain
e is health event for the nvdimm. * "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

[PATCH 1/8] powerpc: Add asm header 'papr_scm.h' describing the papr-scm interface

2020-02-20 Thread Vaibhav Jain
tween PHYP and kernel during those HCALLs. Future patches will use these structures to provide support for retriving nvdimm health and performance stats in papr_scm kernel module. [1]: commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") Signed-off-by: Vai

[PATCH 0/7] powerpc/papr_scm: Add support for reporting nvdimm health

2020-02-20 Thread Vaibhav Jain
s.org/patch/1154292/ [3]: "Linux on Power Architecture Platform Reference" https://members.openpowerfoundation.org/document/dl/469 [4]: https://github.com/vaibhav92/ndctl/tree/papr_scm_health_v1 [5]: https://lore.kernel.org/linuxppc-dev/20200129152844.71286-1-vaib...@linux.ibm.c

[PATCH] powerpc/papr_scm: Mark papr_scm_ndctl() as static

2020-01-29 Thread Vaibhav Jain
Function papr_scm_ndctl() is neither exported from the module nor called directly from outside 'papr.c' hence should be marked 'static'. Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-

[RFC PATCH 6/6] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_STATS

2020-01-29 Thread Vaibhav Jain
tion and then copies PHYP provided buffer that holds these stat attributes to the package payload whose layout is defined by 'struct papr_scm_perf_stats' References: [1]: https://patchwork.ozlabs.org/patch/1154292/ [2]: https://github.com/pmem/ndctl Signed-off-by: Vaibhav Jain

[RFC PATCH 5/6] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-01-29 Thread Vaibhav Jain
hen copies these bitmaps to the package payload whose layout is defined by 'struct papr_scm_ndctl_health'. Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 46 +++ 1 file changed, 46 insertions(+) diff --git a/arch/powerpc/platforms/pserie

[RFC PATCH 4/6] powerpc/papr_scm: Add support for handling PAPR DSM commands

2020-01-29 Thread Vaibhav Jain
) , performs sanity tests on them and converts them to PAPR DSM commands which can then be handled via the switch-case block. Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 96 +-- 1 file changed, 89 insertions(+), 7 deletions(-) diff --git

[RFC PATCH 3/6] UAPI: ndctl: Introduce NVDIMM_FAMILY_PAPR as a new NVDIMM DSM family

2020-01-29 Thread Vaibhav Jain
Add PAPR-scm family of DSM command-set to to the white list of NVDIMM command sets. Signed-off-by: Vaibhav Jain --- include/uapi/linux/ndctl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h index de5d90212409..0e09dc5cec19 100644

[RFC PATCH 2/6] powerpc/papr_scm: Fetch dimm performance stats from PHYP

2020-01-29 Thread Vaibhav Jain
#x27; buffer 'stats'. References: [1]: https://patchwork.ozlabs.org/patch/1154292/ Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 56 +++ 1 file changed, 56 insertions(+) diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/

[RFC PATCH 1/6] powerpc/papr_scm: Provide support for fetching dimm health information

2020-01-29 Thread Vaibhav Jain
27;. References: [1]: https://patchwork.ozlabs.org/patch/1154292/ Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 65 ++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platform

[RFC PATCH 0/6] powerpc/papr_scm: Implement support for reporting DIMM health and stats

2020-01-29 Thread Vaibhav Jain
ower Architecture Platform Reference" https://en.wikipedia.org/wiki/Power_Architecture_Platform_Reference [2]: "[DOC,v2] powerpc: Provide initial documentation for PAPR hcalls" https://patchwork.ozlabs.org/patch/1154292/ [3]: "Linux on Power Architecture Platform Re

[PATCH] libnvdimm/of_pmem: Fix leaking bus_desc.provider_name in some paths

2020-01-22 Thread Vaibhav Jain
robe() as well as in of_pmem_region_remove(). Cc: sta...@vger.kernel.org Fixes:49bddc73d15c2("libnvdimm/of_pmem: Provide a unique name for bus provider") Signed-off-by: Vaibhav Jain --- drivers/nvdimm/of_pmem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvdimm/of_pmem.c b/

[PATCH] libnvdimm/bus: return the outvar 'cmd_rc' error code in __nd_ioctl()

2020-01-22 Thread Vaibhav Jain
lue of out variable 'cmd_rc' back to user-space in case it reports an error. Signed-off-by: Vaibhav Jain --- drivers/nvdimm/bus.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index a8b515968569..5b687a27fdf2 100644 --- a/drivers/nvdimm

[PATCH] powerpc/papr_scm: Fix leaking 'bus_desc.provider_name' in some paths

2020-01-22 Thread Vaibhav Jain
s in papr_scm_remove(). Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c index c2ef320ba1bf..eb420655ed0b 100644 --- a/arch/power

Re: [PATCH] powerpc/papr_scm: Delete unnecessary assignment for the field “owner”

2019-11-04 Thread Vaibhav Jain
gt; .of_match_table = papr_scm_match, > }, > }; > -- > 2.23.0 > LGTM Acked-by: Vaibhav Jain Thanks, -- Vaibhav Jain Linux Technology Center, IBM India Pvt. Ltd.

[PATCH] powerpc/papr_scm: Fix an off-by-one check in papr_scm_meta_{get, set}

2019-09-26 Thread Vaibhav Jain
error -22 The patch fixes these validation checks there by letting libnvdimm access the entire config-area. Fixes: 53e80bd042773('powerpc/nvdimm: Add support for multibyte read/write for metadata') Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 4 ++-- 1 fi

Re: [PATCH v2 2/2] powerpc/nvdimm: use H_SCM_QUERY hcall on H_OVERLAP error

2019-09-03 Thread Vaibhav Jain
get_config_data_hdr *hdr) > { > @@ -430,13 +464,11 @@ static int papr_scm_probe(struct platform_device *pdev) > rc = drc_pmem_bind(p); > > /* If phyp says drc memory still bound then force unbound and retry */ > - if (rc == H_OVERLAP) { > - dev_warn(&pdev->dev, "Retrying bind after unbinding\n"); > - drc_pmem_unbind(p); > - rc = drc_pmem_bind(p); > - } > + if (rc == H_OVERLAP) > + rc = drc_pmem_query_n_bind(p); > > if (rc != H_SUCCESS) { > + dev_err(&p->pdev->dev, "bind err: %d\n", rc); > rc = -ENXIO; > goto err; > } > -- > 2.21.0 > -- Vaibhav Jain Linux Technology Center, IBM India Pvt. Ltd.

Re: [PATCH v2 1/2] powerpc/nvdimm: Use HCALL error as the return value

2019-09-03 Thread Vaibhav Jain
rc = drc_pmem_bind(p); > > /* If phyp says drc memory still bound then force unbound and retry */ > - if (rc == -EBUSY) { > + if (rc == H_OVERLAP) { > dev_warn(&pdev->dev, "Retrying bind after unbinding\n"); > drc_pmem_unbind(p); > rc = drc_pmem_bind(p); > } > > - if (rc) > + if (rc != H_SUCCESS) { > + rc = -ENXIO; > goto err; > + } > > /* setup the resource for the newly bound range */ > p->res.start = p->bound_addr; > -- > 2.21.0 > -- Vaibhav Jain Linux Technology Center, IBM India Pvt. Ltd.

[DOC][PATCH v2] powerpc: Provide initial documentation for PAPR hcalls

2019-08-28 Thread Vaibhav Jain
, how they are issued with the Linux kernel and how information/control flows between the guest and hypervisor. Signed-off-by: Vaibhav Jain --- Change-log: v2: * Added a section on Register conventions to be followed when invoking hcalls. [Nick] * Updated section on HCALL ABI to clarify that

[DOC][PATCH] powerpc: Provide initial documentation for PAPR hcalls

2019-08-27 Thread Vaibhav Jain
, how they are issued with the Linux kernel and how information/control flows between the guest and hypervisor. Signed-off-by: Vaibhav Jain --- Change-log: Initial version of this doc-patch was posted and reviewed as part of the patch-series "[PATCH v5 0/4] powerpc/papr_scm: Workaroun

Re: [PATCH] nvdimm/of_pmem: Provide a unique name for bus provider

2019-08-06 Thread Vaibhav Jain
strdup(pdev->name, GFP_KERNEL); > priv->bus_desc.module = THIS_MODULE; > priv->bus_desc.of_node = np; > > -- > 2.21.0 > Tested-by: Vaibhav Jain -- Vaibhav Jain Linux Technology Center, IBM India Pvt. Ltd.

Re: [DOC][PATCH v5 1/4] powerpc: Document some HCalls for Storage Class Memory

2019-07-29 Thread Vaibhav Jain
Thanks everyone for reviewing this patch-set. The V4 got merged upstream which didn't have this DOC-patch. So, I will re-spin a separate and independent doc-patch incorporating your review comments. Cheers, -- Vaibhav Jain Linux Technology Center, IBM India Pvt. Ltd.

[PATCH v5 4/4] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails

2019-07-23 Thread Vaibhav Jain
error returned by phyp and indicate it as a EBUSY error back to the caller. Suggested-by: "Oliver O'Halloran" Signed-off-by: Vaibhav Jain Reviewed-by: Oliver O'Halloran --- Change-log: v5: * None. Re-spinning the patchset. v4: * None. Re-spinning the patchset. v3: * Minor update t

[PATCH v5 3/4] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-07-23 Thread Vaibhav Jain
. * Ensure appropriate error code is returned back from the function in case of an error. Reviewed-by: Oliver O'Halloran Signed-off-by: Vaibhav Jain --- Change-log: v5: * None. Re-spinning the patchset. v4: * None. Re-spinning the patchset. v3: * Fixed a build warning repo

[PATCH v5 2/4] powerpc/pseries: Update SCM hcall op-codes in hvcall.h

2019-07-23 Thread Vaibhav Jain
implemented by Power-VM nor they were used anywhere in Linux kernel. Hence we don't expect anyone to be impacted by this change. Signed-off-by: Vaibhav Jain --- Change-log: v5: * None. Re-spinning the patchset. v4: * Updated the patch description mentioned current status of removed hcall opcodes.

[DOC][PATCH v5 1/4] powerpc: Document some HCalls for Storage Class Memory

2019-07-23 Thread Vaibhav Jain
of how Hcalls are implemented inside the Linux kernel and how information flows between kernel and PowerVM/KVM. Signed-off-by: Vaibhav Jain --- Change-log: v5 * First patch in this patchset. --- Documentation/powerpc/hcalls.txt | 140 +++ 1 file changed, 140

[PATCH v5 0/4] powerpc/papr_scm: Workaround for failure of drc bind after kexec

2019-07-23 Thread Vaibhav Jain
sted by Mpe. v3: * Fixed a build warning reported by kbuild test robot. * Updated the hcall opcode from latest papr-scm specification. * Fixed a minor code comment & patch description as pointed out by Oliver. v2: * Addressed review comments from Oliver on v1 patchset. Vaibhav Jain (4): power

Re: [PATCH v3 1/3] powerpc/pseries: Update SCM hcall op-codes in hvcall.h

2019-06-29 Thread Vaibhav Jain
Thanks for reviewing this patch Mpe. Michael Ellerman writes: > "Oliver O'Halloran" writes: >> On Fri, Jun 28, 2019 at 1:39 PM Michael Ellerman wrote: >>> >>> Vaibhav Jain writes: >>> > *snip* >>> >>> How can we be

[PATCH v4 3/3] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails

2019-06-29 Thread Vaibhav Jain
error returned by phyp and indicate it as a EBUSY error back to the caller. Suggested-by: "Oliver O'Halloran" Signed-off-by: Vaibhav Jain Reviewed-by: Oliver O'Halloran --- Change-log: v4: * None. Re-spinning the patchset. v3: * Minor update to a code comment. [Oliver] v2: *

[PATCH v4 2/3] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-06-29 Thread Vaibhav Jain
. * Ensure appropriate error code is returned back from the function in case of an error. Reviewed-by: Oliver O'Halloran Signed-off-by: Vaibhav Jain --- Change-log: v4: * None. Re-spinning the patchset. v3: * Fixed a build warning reported by kbuild-robot. * Updated patch descriptio

[PATCH v4 1/3] powerpc/pseries: Update SCM hcall op-codes in hvcall.h

2019-06-29 Thread Vaibhav Jain
implemented by Power-VM nor they were used anywhere in Linux kernel. Hence we don't expect anyone to be impacted by this change. Signed-off-by: Vaibhav Jain --- Change-log: v4: * Updated the patch description mentioned current status of removed hcall opcodes. [Mpe] v3: * Added updated opcod

[PATCH v4 0/3] powerpc/papr_scm: Workaround for failure of drc bind after kexec

2019-06-29 Thread Vaibhav Jain
on. * Fixed a minor code comment & patch description as pointed out by Oliver. v2: * Addressed review comments from Oliver on v1 patchset. Vaibhav Jain (3): powerpc/pseries: Update SCM hcall op-codes in hvcall.h powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL powerpc/pa

Re: ["RFC PATCH" 2/2] powerpc/mm: Conslidate numa_enable check and min_common_depth check

2019-06-29 Thread Vaibhav Jain
t hot_add_scn_to_nid(unsigned long scn_addr) > struct device_node *memory = NULL; > int nid; > > - if (!numa_enabled || (min_common_depth < 0)) > + if (min_common_depth < 0) > return first_online_node; > > memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); > -- > 2.21.0 > -- Vaibhav Jain Linux Technology Center, IBM India Pvt. Ltd.

Re: [PATCH v3 2/3] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-06-27 Thread Vaibhav Jain
Thanks for reviewing this patch Aneesh, "Aneesh Kumar K.V" writes: > On 6/26/19 7:34 PM, Vaibhav Jain wrote: >> The new hcall named H_SCM_UNBIND_ALL has been introduce that can >> unbind all or specific scm memory assigned to an lpar. This is >> more efficient

[PATCH v3 3/3] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails

2019-06-26 Thread Vaibhav Jain
error returned by phyp and indicate it as a EBUSY error back to the caller. Suggested-by: "Oliver O'Halloran" Signed-off-by: Vaibhav Jain Reviewed-by: Oliver O'Halloran --- Change-log: v3: * Minor update to a code comment. [Oliver] v2: * Moved the retry code from drc_pmem

[PATCH v3 1/3] powerpc/pseries: Update SCM hcall op-codes in hvcall.h

2019-06-26 Thread Vaibhav Jain
Update the hvcalls.h to include op-codes for new hcalls introduce to manage SCM memory. Also update existing hcall definitions to reflect current papr specification for SCM. Signed-off-by: Vaibhav Jain --- Change-log: v3: * Added updated opcode for H_SCM_HEALTH [Oliver] v2: * None new patch in

[PATCH v3 2/3] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-06-26 Thread Vaibhav Jain
. * Ensure appropriate error code is returned back from the function in case of an error. Reviewed-by: Oliver O'Halloran Signed-off-by: Vaibhav Jain --- Change-log: v3: * Fixed a build warning reported by kbuild-robot. * Updated patch description to put emphasis on 'scm memo

[PATCH v3 0/3] powerpc/papr_scm: Workaround for failure of drc bind after kexec

2019-06-26 Thread Vaibhav Jain
tl list -R [ { "dev":"region0", } ] --- Change-log: v3: * Fixed a build warning reported by kbuild test robot. * Updated the hcall opcode from latest papr-scm specification. * Fixed a minor code comment & patch description as pointed out by Oliver. v2: * Add

[PATCH v2 3/3] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails

2019-06-25 Thread Vaibhav Jain
error returned by phyp and indicate it as a EBUSY error back to the caller. Suggested-by: "Oliver O'Halloran" Signed-off-by: Vaibhav Jain --- Change-log: v2: * Moved the retry code from drc_pmem_bind() to papr_scm_probe() [Oliver] * Changed the type of variable 'rc' in drc_pme

[PATCH v2 2/3] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-06-25 Thread Vaibhav Jain
7; return value. * Ensure appropriate error code is returned back from the function in case of an error. Signed-off-by: Vaibhav Jain --- Change-log: v2: * Added a dev_dbg when unbind operation succeeds [Oliver] * Changed type of variable 'rc' to int64_t [Oliver] * Removed the code that

[PATCH v2 0/3] powerpc/papr_scm: Workaround for failure of drc bind after kexec

2019-06-25 Thread Vaibhav Jain
tl list -R [ { "dev":"region0", } ] --- Change-log: v2: * Addressed review comments from Oliver on v1 patchset. Vaibhav Jain (3): powerpc/pseries: Update SCM hcall op-codes in hvcall.h powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL p

[PATCH v2 1/3] powerpc/pseries: Update SCM hcall op-codes in hvcall.h

2019-06-25 Thread Vaibhav Jain
Update the hvcalls.h to include op-codes for new hcalls introduce to manage SCM memory. Also update existing hcall definitions to reflect current papr specification for SCM. Signed-off-by: Vaibhav Jain --- Change-log: v2: * None new patch in this series. --- arch/powerpc/include/asm/hvcall.h

[PATCH 2/2] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails

2019-06-24 Thread Vaibhav Jain
patch updates drc_pmem_bind() to force a call to drc_pmem_unbind() in case the initial bind of scm memory fails with H_OVERLAP error. In case scm-bind operation again fails after the forced scm-unbind then we follow the existing error path. Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/ps

[PATCH 0/2] powerpc/papr_scm: Workaround for failure of drc bind after kexec

2019-06-24 Thread Vaibhav Jain
t;dev":"region0", } ] # kexec to new kernel $ sudo kexec --initrd=... vmlinux ... ... I'm in purgatory ... papr_scm ibm,persistent-memory:ibm,pmemory@4412: Un-binding and retrying ... # New kernel $ sudo ndctl list -R $ sudo ndctl list -R [ { "dev":"region0&q

[PATCH 1/2] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-06-24 Thread Vaibhav Jain
eturn value. In case it takes more than 1 second to unbind the memory log a warning. * Ensure appropriate error code is returned back from the function in case of an error. Signed-off-by: Vaibhav Jain --- arch/powerpc/include/asm/hvcall.h | 2 +- arch/powerpc/platforms/pse

Re: [PATCH] powerpc/mm: Ensure Huge-page memory is free before allocation

2019-06-18 Thread Vaibhav Jain
Michael Ellerman writes: > Vaibhav Jain writes: >> We recently discovered an bug where physical memory meant for >> allocation of Huge-pages was inadvertently allocated by another component >> during early boot. > > Can you give me some more detail on what that was?

[PATCH] powerpc/mm: Ensure Huge-page memory is free before allocation

2019-06-17 Thread Vaibhav Jain
the the kernel to ensure that user of this huge-page doesn't accidentally stomp on memory allocated to someone else. Signed-off-by: Vaibhav Jain --- arch/powerpc/mm/book3s64/hash_utils.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/po

Re: [PATCH] mm/nvdimm: Pick the right alignment default when creating dax devices

2019-05-17 Thread Vaibhav Jain
daxio: copied 2130706432 bytes to device "/dev/dax0.0" Hence, Tested-by: Vaibhav Jain "Aneesh Kumar K.V" writes: > Allow arch to provide the supported alignments and use hugepage alignment only > if we support hugepage. Right now we depend on compile tim

Re: [RESEND PATCH v3] cxl: Wrap iterations over afu slices inside 'afu_list_lock'

2019-01-30 Thread Vaibhav Jain
perfectly valid reason for a new version of the patch. Thanks for pointing this out. Will take care of this in future. > > I've applied it, no need to RESEND ;) Thanks. -- Vaibhav Jain Linux Technology Center, IBM India Pvt. Ltd.

[PATCH] scsi: cxlflash: Prevent deadlock when adapter probe fails

2019-01-30 Thread Vaibhav Jain
fore calling cxlflash_remove(). Cc: sta...@vger.kernel.org Fixes: c21e0bbfc485("cxlflash: Base support for IBM CXL Flash Adapter") Signed-off-by: Vaibhav Jain --- drivers/scsi/cxlflash/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi

<    1   2   3   4   5   >