[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1256440269.161757055784348.JavaMail.epsvc@epcpadp2new>
Date: Thu, 4 Sep 2025 20:09:33 +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 V2 13/20] cxl/mem: Refactor cxl pmem region
auto-assembling
On 20/08/25 09:41AM, Dave Jiang wrote:
>
>
>On 7/30/25 5:12 AM, Neeraj Kumar wrote:
>> In 84ec985944ef3, devm_cxl_add_nvdimm() sequence was changed and called
>> before devm_cxl_add_endpoint(). It's because cxl pmem region auto-assembly
>> used to get called at last in cxl_endpoint_port_probe(), which requires
>> cxl_nvd presence.
>>
>> For cxl region persistency, region creation happens during nvdimm_probe
>> which need the completion of endpoint probe.
>>
>> In order to accommodate both cxl pmem region auto-assembly and cxl region
>> persistency, refactored following
>>
>> 1. Re-Sequence devm_cxl_add_nvdimm() after devm_cxl_add_endpoint(). This
>> will be called only after successful completion of endpoint probe.
>>
>> 2. Moved cxl pmem region auto-assembly from cxl_endpoint_port_probe() to
>> cxl_mem_probe() after devm_cxl_add_nvdimm(). It gurantees both the
>> completion of endpoint probe and cxl_nvd presence before its call.
>
>So there are a few issues with doing this. If cxl_endpoint_port_probe() fails, you won't know that while running in cxl_mem_probe(). So you may need to do something similar to here [1] in order to make the probe synchronous with the add endpoint and make sure that the port driver attached successfully.
Hi Dave,
devm_cxl_add_endpoint() makes sure cxl_endpoint_port_probe() has
completed successfully, as per below check in devm_cxl_add_endpoint()
if (!endpoint->dev.driver) {
dev_err(&cxlmd->dev, "%s failed probe\n", dev_name(&endpoint->dev));
return -ENXIO;
}
Above check confirms synchronous probe completion of cxl_endpoint_port_probe() and port
driver attachment.
> Specifically see changes to devm_cxl_add_memdev().
>
>Also, in endpoint port probe you are holding the device lock and therefore is protected from port removals (endpoint and parents) while you are trying to scan for regions. That is not the case on the memdev probe side if you aren't holding that port lock.
>
>[1]: https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git/commit/?h=for-6.18/cxl-probe-order&id=88aec5ea7a24da00dc92c7778df4851fe4fd3ec6
>
>DJ
Sure, I will go through [1] and its devm_cxl_add_memdev() implementation.
And see if any changes required as per your suggestion.
Regards,
Neeraj
Powered by blists - more mailing lists