[PATCH V5 09/17] nvdimm/label: Export routine to fetch region information

Neeraj Kumar posted 17 patches 1 month ago
There is a newer version of this series
[PATCH V5 09/17] nvdimm/label: Export routine to fetch region information
Posted by Neeraj Kumar 1 month ago
CXL region information preserved from the LSA needs to be exported for
use by the CXL driver for CXL region re-creation.

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Neeraj Kumar <s.neeraj@samsung.com>
---
 drivers/nvdimm/dimm_devs.c | 12 ++++++++++++
 include/linux/libnvdimm.h  |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
index 3363a97cc5b5..e1c95da92fbf 100644
--- a/drivers/nvdimm/dimm_devs.c
+++ b/drivers/nvdimm/dimm_devs.c
@@ -280,6 +280,18 @@ void *nvdimm_provider_data(struct nvdimm *nvdimm)
 }
 EXPORT_SYMBOL_GPL(nvdimm_provider_data);
 
+bool nvdimm_has_cxl_region(struct nvdimm *nvdimm)
+{
+	return nvdimm->is_region_label;
+}
+EXPORT_SYMBOL_GPL(nvdimm_has_cxl_region);
+
+void *nvdimm_get_cxl_region_param(struct nvdimm *nvdimm)
+{
+	return &nvdimm->cxl_region_params;
+}
+EXPORT_SYMBOL_GPL(nvdimm_get_cxl_region_param);
+
 static ssize_t commands_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
 {
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index 07ea2e3f821a..3ffd50ab6ac4 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -330,6 +330,8 @@ int nvdimm_in_overwrite(struct nvdimm *nvdimm);
 bool is_nvdimm_sync(struct nd_region *nd_region);
 int nd_region_label_update(struct nd_region *nd_region);
 int nd_region_label_delete(struct nd_region *nd_region);
+bool nvdimm_has_cxl_region(struct nvdimm *nvdimm);
+void *nvdimm_get_cxl_region_param(struct nvdimm *nvdimm);
 
 static inline int nvdimm_ctl(struct nvdimm *nvdimm, unsigned int cmd, void *buf,
 		unsigned int buf_len, int *cmd_rc)
-- 
2.34.1
Re: [PATCH V5 09/17] nvdimm/label: Export routine to fetch region information
Posted by Ira Weiny 2 weeks, 5 days ago
Neeraj Kumar wrote:
> CXL region information preserved from the LSA needs to be exported for
> use by the CXL driver for CXL region re-creation.
> 

Some of the CXL tree patches did not apply cleanly to cxl/next.

Up to this point I ran the nvdimm tests which showed that none of this
broken existing functionality.

Will there be additional nvdimm tests for this?

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

[snip]
Re: [PATCH V5 09/17] nvdimm/label: Export routine to fetch region information
Posted by Neeraj Kumar 2 weeks, 3 days ago
On 20/01/26 06:46PM, Ira Weiny wrote:
>Neeraj Kumar wrote:
>> CXL region information preserved from the LSA needs to be exported for
>> use by the CXL driver for CXL region re-creation.
>>
>
>Some of the CXL tree patches did not apply cleanly to cxl/next.

I have rebased V6 with for-7.0/cxl-init. Can you please check with V6.


Regards,
Neeraj
Re: [PATCH V5 09/17] nvdimm/label: Export routine to fetch region information
Posted by Neeraj Kumar 2 weeks, 3 days ago
On 20/01/26 06:46PM, Ira Weiny wrote:
>Neeraj Kumar wrote:
>> CXL region information preserved from the LSA needs to be exported for
>> use by the CXL driver for CXL region re-creation.
>>
>
>Some of the CXL tree patches did not apply cleanly to cxl/next.
>
>Up to this point I ran the nvdimm tests which showed that none of this
>broken existing functionality.
>
>Will there be additional nvdimm tests for this?

No I have not added any additional test for this.
This is tested using qemu and mentioned its procedure in cover letter

>
>Reviewed-by: Ira Weiny <ira.weiny@intel.com>

Thanks Ira for RB tag.


Regards,
Neeraj
Re: [PATCH V5 09/17] nvdimm/label: Export routine to fetch region information
Posted by Jonathan Cameron 3 weeks, 3 days ago
On Fri,  9 Jan 2026 18:14:29 +0530
Neeraj Kumar <s.neeraj@samsung.com> wrote:

> CXL region information preserved from the LSA needs to be exported for
> use by the CXL driver for CXL region re-creation.
> 
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> Signed-off-by: Neeraj Kumar <s.neeraj@samsung.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>