On 15/01/26 05:45PM, Jonathan Cameron wrote:
On Fri, 9 Jan 2026 18:14:23 +0530
Neeraj Kumar <[email protected]> wrote:
Modify __pmem_label_update() to update region labels into LSA
CXL 3.2 Spec mentions CXL LSA 2.1 Namespace Labels at section 9.13.2.5
Modified __pmem_label_update() using setter functions to update
namespace label as per CXL LSA 2.1
Create export routine nd_region_label_update() used for creating
region label into LSA. It will be used later from CXL subsystem
Reviewed-by: Dave Jiang <[email protected]>
Signed-off-by: Neeraj Kumar <[email protected]>
Hi Neeraj,
There are a few more instances of copying in and out of UUIDs that
should be using the import and export functions.
With those fixed up,
Reviewed-by: Jonathan Cameron <[email protected]>
---
drivers/nvdimm/label.c | 360 ++++++++++++++++++++++++++------
drivers/nvdimm/label.h | 17 +-
drivers/nvdimm/namespace_devs.c | 20 +-
drivers/nvdimm/nd.h | 51 +++++
include/linux/libnvdimm.h | 8 +
5 files changed, 386 insertions(+), 70 deletions(-)
diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
index 0a9b6c5cb2c3..17e2a1f5a6da 100644
--- a/drivers/nvdimm/label.c
+++ b/drivers/nvdimm/label.c
+static void region_label_update(struct nd_region *nd_region,
+ struct cxl_region_label *region_label,
+ struct nd_mapping *nd_mapping,
+ int pos, u64 flags, u32 slot)
+{
+ struct nd_interleave_set *nd_set = nd_region->nd_set;
+ struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
+
+ /* Set Region Label Format identification UUID */
+ uuid_copy((uuid_t *)region_label->type, &cxl_region_uuid);
Why is this one not an export_uuid()?
Yes I have used it to avoid extra typecasting in v6
+
+static inline bool is_region_label(struct nvdimm_drvdata *ndd,
+ union nd_lsa_label *lsa_label)
+{
+ if (!ndd->cxl)
+ return false;
+
+ return uuid_equal(&cxl_region_uuid,
+ (uuid_t *)lsa_label->region_label.type);
As below.
+}
+
+static inline bool
+region_label_uuid_equal(struct cxl_region_label *region_label,
+ const uuid_t *uuid)
+{
+ return uuid_equal((uuid_t *)region_label->uuid, uuid);
Not appropriate to do an import_uuid() for this and similar cases?
In general I don't think we should see any casts to uuid_t *
There are 3 instances of this in the kernel and we should probably clean
all those up. There are a lot more doing the import!
I have used import_uuid() accordingly in v6 and will be sending it soon
Regards,
Neeraj