summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDan Williams <djbw@kernel.org>2026-05-19 14:01:58 -0700
committerDave Jiang <dave.jiang@intel.com>2026-06-12 13:47:30 -0700
commitd8dcb0b74b045e36d627935a959c3cf4c8cb2f7c (patch)
tree7cbc745a96846eafbbad4438361fd826ba3a1aa6 /tools
parent2ed519c21bb4fbac5d544ef4b1f98d515b18036d (diff)
downloadlwn-d8dcb0b74b045e36d627935a959c3cf4c8cb2f7c.tar.gz
lwn-d8dcb0b74b045e36d627935a959c3cf4c8cb2f7c.zip
cxl/region: Introduce devm_cxl_probe_mem()
To date, platform firmware maps accelerator memory and accelerator drivers simply want an address range that they can map themselves. This typically results in a single region being auto-assembled upon registration of a memory device. Use the @attach mechanism of devm_cxl_add_memdev() parameter to retrieve that region while also adhering to CXL subsystem locking and lifetime rules. As part of adhering to current object lifetime rules, if the region or the CXL port topology is invalidated, the CXL core arranges for the accelertor driver to be detached as well. The locking and lifetime rules were validated with Dave's work-in-progress cxl-type-2 support for cxl_test. devm_cxl_add_classdev() supports the general memory expansion flow where region assembly is optional, dynamic, and user controlled. Cc: Alejandro Lucero <alucerop@amd.com> Signed-off-by: Dan Williams <djbw@kernel.org> Reviewed-by: Alejandro Lucero <alucerop@amd.com> Tested-by: Alejandro Lucero <alucerop@amd.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/20260519210158.1499795-6-djbw@kernel.org Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/cxl/test/mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c
index 271c7ad8cc32..095ca544ac02 100644
--- a/tools/testing/cxl/test/mem.c
+++ b/tools/testing/cxl/test/mem.c
@@ -1769,7 +1769,7 @@ static int cxl_mock_mem_probe(struct platform_device *pdev)
cxl_mock_add_event_logs(&mdata->mes);
- cxlmd = devm_cxl_add_memdev(cxlds, NULL);
+ cxlmd = devm_cxl_add_classdev(cxlds);
if (IS_ERR(cxlmd))
return PTR_ERR(cxlmd);