On 17/12/25 03:40PM, Jonathan Cameron wrote:
On Wed, 19 Nov 2025 13:22:53 +0530
Neeraj Kumar <[email protected]> wrote:

Using these attributes region label is added/deleted into LSA. These
attributes are called from userspace (ndctl) after region creation.

Signed-off-by: Neeraj Kumar <[email protected]>
One quick addition to what Dave called out.

Thanks,

Jonathan

diff --git a/drivers/cxl/core/pmem_region.c b/drivers/cxl/core/pmem_region.c
index b45e60f04ff4..be4feb73aafc 100644
--- a/drivers/cxl/core/pmem_region.c
+++ b/drivers/cxl/core/pmem_region.c
@@ -30,9 +30,100 @@ static void cxl_pmem_region_release(struct device *dev)
        kfree(cxlr_pmem);
 }

+static ssize_t region_label_update_store(struct device *dev,
+                                        struct device_attribute *attr,
+                                        const char *buf, size_t len)
+{
+       struct cxl_pmem_region *cxlr_pmem = to_cxl_pmem_region(dev);
+       struct cxl_region *cxlr = cxlr_pmem->cxlr;
+       ssize_t rc;
+       bool update;
+
+       rc = kstrtobool(buf, &update);
+       if (rc)
+               return rc;
+
+       ACQUIRE(rwsem_write_kill, rwsem)(&cxl_rwsem.region);
+       rc = ACQUIRE_ERR(rwsem_write_kill, &rwsem);
+       if (rc)
I'd stick to one style for these.  Elsewhere you have
        if ((rc = ACQUIRE_ERR())


Fixed it accordingly in V5


Regards,
Neeraj


Reply via email to