[PATCH V5 05/17] nvdimm/label: Skip region label during ns label DPA reservation

Neeraj Kumar posted 17 patches 1 month ago
There is a newer version of this series
[PATCH V5 05/17] nvdimm/label: Skip region label during ns label DPA reservation
Posted by Neeraj Kumar 1 month ago
CXL 3.2 Spec mentions CXL LSA 2.1 Namespace Labels at section
9.13.2.5. If Namespace label is present in LSA during
nvdimm_probe() then dimm-physical-address(DPA) reservation is
required. But this reservation is not required by cxl region
label. Therefore if LSA scanning finds any region label, skip it.

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Neeraj Kumar <s.neeraj@samsung.com>
---
 drivers/nvdimm/label.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
index 9854cb45fb62..169692dfa12c 100644
--- a/drivers/nvdimm/label.c
+++ b/drivers/nvdimm/label.c
@@ -469,6 +469,14 @@ int nd_label_reserve_dpa(struct nvdimm_drvdata *ndd)
 		lsa_label = to_lsa_label(ndd, slot);
 		nd_label = &lsa_label->ns_label;
 
+		/*
+		 * Skip region label. If LSA label is region label
+		 * then it don't require dimm-physical-address(DPA)
+		 * reservation. Whereas its required for namespace label
+		 */
+		if (is_region_label(ndd, lsa_label))
+			continue;
+
 		if (!slot_valid(ndd, lsa_label, slot))
 			continue;
 
-- 
2.34.1
Re: [PATCH V5 05/17] nvdimm/label: Skip region label during ns label DPA reservation
Posted by Ira Weiny 2 weeks, 5 days ago
Neeraj Kumar wrote:
> CXL 3.2 Spec mentions CXL LSA 2.1 Namespace Labels at section
> 9.13.2.5. If Namespace label is present in LSA during
> nvdimm_probe() then dimm-physical-address(DPA) reservation is
> required. But this reservation is not required by cxl region
> label. Therefore if LSA scanning finds any region label, skip it.
> 
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> Signed-off-by: Neeraj Kumar <s.neeraj@samsung.com>
> ---
>  drivers/nvdimm/label.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
> index 9854cb45fb62..169692dfa12c 100644
> --- a/drivers/nvdimm/label.c
> +++ b/drivers/nvdimm/label.c
> @@ -469,6 +469,14 @@ int nd_label_reserve_dpa(struct nvdimm_drvdata *ndd)
>  		lsa_label = to_lsa_label(ndd, slot);
>  		nd_label = &lsa_label->ns_label;
>  
> +		/*
> +		 * Skip region label. If LSA label is region label
                   ^^^^^^^^^^^^^^^^^^
		   This is redundant
> +		 * then it don't require dimm-physical-address(DPA)
                           ^^^^^
			   doesn't

> +		 * reservation. Whereas its required for namespace label
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
				This is somewhat confusing and redundant
				as well.

Simply say.

	/*
	 * If the LSA label is a region label then it doesn't require a
	 * dimm-physical-address(DPA) reservation.
	 */

With that.

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

> +		if (is_region_label(ndd, lsa_label))
> +			continue;
> +
>  		if (!slot_valid(ndd, lsa_label, slot))
>  			continue;
>  
> -- 
> 2.34.1
> 
>
Re: [PATCH V5 05/17] nvdimm/label: Skip region label during ns label DPA reservation
Posted by Neeraj Kumar 2 weeks, 3 days ago
On 20/01/26 06:41PM, Ira Weiny wrote:
>Neeraj Kumar wrote:
>> CXL 3.2 Spec mentions CXL LSA 2.1 Namespace Labels at section
>> 9.13.2.5. If Namespace label is present in LSA during
>> nvdimm_probe() then dimm-physical-address(DPA) reservation is
>> required. But this reservation is not required by cxl region
>> label. Therefore if LSA scanning finds any region label, skip it.
>>
>> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
>> Signed-off-by: Neeraj Kumar <s.neeraj@samsung.com>
>> ---
>>  drivers/nvdimm/label.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
>> index 9854cb45fb62..169692dfa12c 100644
>> --- a/drivers/nvdimm/label.c
>> +++ b/drivers/nvdimm/label.c
>> @@ -469,6 +469,14 @@ int nd_label_reserve_dpa(struct nvdimm_drvdata *ndd)
>>  		lsa_label = to_lsa_label(ndd, slot);
>>  		nd_label = &lsa_label->ns_label;
>>
>> +		/*
>> +		 * Skip region label. If LSA label is region label
>                   ^^^^^^^^^^^^^^^^^^
>		   This is redundant
>> +		 * then it don't require dimm-physical-address(DPA)
>                           ^^^^^
>			   doesn't
>
>> +		 * reservation. Whereas its required for namespace label
>                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>				This is somewhat confusing and redundant
>				as well.
>
>Simply say.
>
>	/*
>	 * If the LSA label is a region label then it doesn't require a
>	 * dimm-physical-address(DPA) reservation.
>	 */
>
>With that.

Fixed it accordingly in V6

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

Thanks Ira.


Regards,
Neeraj
Re: [PATCH V5 05/17] nvdimm/label: Skip region label during ns label DPA reservation
Posted by Jonathan Cameron 3 weeks, 3 days ago
On Fri,  9 Jan 2026 18:14:25 +0530
Neeraj Kumar <s.neeraj@samsung.com> wrote:

> CXL 3.2 Spec mentions CXL LSA 2.1 Namespace Labels at section
> 9.13.2.5. If Namespace label is present in LSA during
> nvdimm_probe() then dimm-physical-address(DPA) reservation is
> required. But this reservation is not required by cxl region
> label. Therefore if LSA scanning finds any region label, skip it.
> 
> 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>

> ---
>  drivers/nvdimm/label.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
> index 9854cb45fb62..169692dfa12c 100644
> --- a/drivers/nvdimm/label.c
> +++ b/drivers/nvdimm/label.c
> @@ -469,6 +469,14 @@ int nd_label_reserve_dpa(struct nvdimm_drvdata *ndd)
>  		lsa_label = to_lsa_label(ndd, slot);
>  		nd_label = &lsa_label->ns_label;
>  
> +		/*
> +		 * Skip region label. If LSA label is region label
> +		 * then it don't require dimm-physical-address(DPA)
> +		 * reservation. Whereas its required for namespace label
> +		 */
> +		if (is_region_label(ndd, lsa_label))
> +			continue;
> +
>  		if (!slot_valid(ndd, lsa_label, slot))
>  			continue;
>