[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260123111638.6fv2ixs5e7rhomeg@test-PowerEdge-R740xd>
Date: Fri, 23 Jan 2026 16:47:08 +0530
From: Neeraj Kumar <s.neeraj@...sung.com>
To: Jonathan Cameron <jonathan.cameron@...wei.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 V5 11/17] cxl/region: Add devm_cxl_pmem_add_region() for
pmem region creation
On 15/01/26 06:17PM, Jonathan Cameron wrote:
>On Fri, 9 Jan 2026 18:14:31 +0530
>Neeraj Kumar <s.neeraj@...sung.com> 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.
>You also add a couple of parameters. At very least say why here.
Not required now, I have created a separate patch for this.
>
>>
>> Reviewed-by: Dave Jiang <dave.jiang@...el.com>
>> Signed-off-by: Neeraj Kumar <s.neeraj@...sung.com>
>
>A few things inline.
>
>> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
>> index 26238fb5e8cf..13779aeacd8e 100644
>> --- a/drivers/cxl/core/region.c
>> +++ b/drivers/cxl/core/region.c
>
>
>> +static ssize_t alloc_region_dpa(struct cxl_endpoint_decoder *cxled, u64 size)
>> +{
>> + int rc;
>> +
>> + if (!size)
>> + return -EINVAL;
>> +
>> + if (!IS_ALIGNED(size, SZ_256M))
>> + return -EINVAL;
>> +
>> + rc = cxl_dpa_free(cxled);
>
>Add a comment on why this make sense. What already allocated dpa that we need
>to clean up?
Inspiration of alloc_region_dpa() is taken from size_store(). But yes here its not
required. I have removed it accordingly in V6
>
>> + if (rc)
>> + return rc;
>> +
>> + return cxl_dpa_alloc(cxled, size);
>> +}
>
>
>> -static struct cxl_region *__create_region(struct cxl_root_decoder *cxlrd,
>> - enum cxl_partition_mode mode, int id)
>> +struct cxl_region *cxl_create_region(struct cxl_root_decoder *cxlrd,
>> + enum cxl_partition_mode mode, int id,
>> + struct cxl_pmem_region_params *pmem_params,
>> + struct cxl_endpoint_decoder *cxled)
>
>I'm a little dubious that the extra parameters are buried in this patch rather than
>where we first need them or a separate patch that makes it clear what they are for.
Yes I have separated it out in V6.
Regards,
Neeraj
Powered by blists - more mailing lists