[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1931444790.41768145283345.JavaMail.epsvc@epcpadp2new>
Date: Fri, 9 Jan 2026 17:43:48 +0530
From: Neeraj Kumar <s.neeraj@...sung.com>
To: Dave Jiang <dave.jiang@...el.com>
Cc: linux-cxl@...r.kernel.org, nvdimm@...ts.linux.dev,
linux-kernel@...r.kernel.org, gost.dev@...sung.com,
a.manzanares@...sung.com, vishak.g@...sung.com, neeraj.kernel@...il.com,
cpgs@...sung.com
Subject: Re: [PATCH V4 11/17] cxl/region: Add devm_cxl_pmem_add_region() for
pmem region creation
On 19/11/25 02:33PM, Dave Jiang wrote:
>
>
>On 11/19/25 12:52 AM, Neeraj Kumar wrote:
>> devm_cxl_pmem_add_region() is used to create cxl region based on region
>> information scanned from LSA.
>>
>> devm_cxl_add_region() is used to just allocate cxlr and its fields are
>> filled later by userspace tool using device attributes (*_store()).
>>
>> Inspiration for devm_cxl_pmem_add_region() is taken from these device
>> attributes (_store*) calls. It allocates cxlr and fills information
>> parsed from LSA and calls device_add(&cxlr->dev) to initiate further
>> region creation porbes
>>
>> Rename __create_region() to cxl_create_region(), which will be used
>> in later patch to create cxl region after fetching region information
>> from LSA.
>>
>> Signed-off-by: Neeraj Kumar <s.neeraj@...sung.com>
>
>small comment below, otherwise
>Reviewed-by: Dave Jiang <dave.jiang@...el.com>
Thanks Dave for RB tag.
>
>> ---
>> drivers/cxl/core/core.h | 12 ++++
>> drivers/cxl/core/region.c | 124 ++++++++++++++++++++++++++++++++++++--
>> 2 files changed, 131 insertions(+), 5 deletions(-)
>>
>> --- a/drivers/cxl/core/region.c
>> +++ b/drivers/cxl/core/region.c
>>
>> +static ssize_t alloc_region_hpa(struct cxl_region *cxlr, u64 size)
>> +{
>> + int rc;
>> +
>> + ACQUIRE(rwsem_write_kill, rwsem)(&cxl_rwsem.region);
>> + if ((rc = ACQUIRE_ERR(rwsem_write_kill, &rwsem)))
>> + return rc;
>> +
>> + if (!size)
>> + return -EINVAL;
>
>Why not do this check before acquiring the lock?
>
>DJ
Fixed it in V5.
Regards,
Neeraj
Powered by blists - more mailing lists