]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dax/hmem, cxl: Defer and resolve Soft Reserved ownership
authorSmita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
Sun, 22 Mar 2026 19:53:41 +0000 (19:53 +0000)
committerDave Jiang <dave.jiang@intel.com>
Fri, 27 Mar 2026 17:25:47 +0000 (10:25 -0700)
commite4de6b910bf3645c224cd873d4e03ce3dd81fbe0
treeaab2fef4d3be790841364699f74da40c222ee323
parent8e65f99b525b3f49b87db0db0d0e0fc1a0c53e40
dax/hmem, cxl: Defer and resolve Soft Reserved ownership

The current probe time ownership check for Soft Reserved memory based
solely on CXL window intersection is insufficient. dax_hmem probing is not
always guaranteed to run after CXL enumeration and region assembly, which
can lead to incorrect ownership decisions before the CXL stack has
finished publishing windows and assembling committed regions.

Introduce deferred ownership handling for Soft Reserved ranges that
intersect CXL windows. When such a range is encountered during the
initial dax_hmem probe, schedule deferred work to wait for the CXL stack
to complete enumeration and region assembly before deciding ownership.

Once the deferred work runs, evaluate each Soft Reserved range
individually: if a CXL region fully contains the range, skip it and let
dax_cxl bind. Otherwise, register it with dax_hmem. This per-range
ownership model avoids the need for CXL region teardown and
alloc_dax_region() resource exclusion prevents double claiming.

Introduce a boolean flag dax_hmem_initial_probe to live inside device.c
so it survives module reload. Ensure dax_cxl defers driver registration
until dax_hmem has completed ownership resolution. dax_cxl calls
dax_hmem_flush_work() before cxl_driver_register(), which both waits for
the deferred work to complete and creates a module symbol dependency that
forces dax_hmem.ko to load before dax_cxl.

Co-developed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20260322195343.206900-9-Smita.KoralahalliChannabasappa@amd.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/dax/bus.h
drivers/dax/cxl.c
drivers/dax/hmem/device.c
drivers/dax/hmem/hmem.c