]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dax/hmem: Request cxl_acpi and cxl_pci before walking Soft Reserved ranges
authorDan Williams <dan.j.williams@intel.com>
Sun, 22 Mar 2026 19:53:36 +0000 (19:53 +0000)
committerDave Jiang <dave.jiang@intel.com>
Fri, 27 Mar 2026 17:17:43 +0000 (10:17 -0700)
commit7b4bcaadfe00e2447c84378291e854ea87a2a41c
tree5969f415bdcda7fb94ee2d3dea749547cc01e4e1
parent116be1e112cbcb664887e44b74f27316a5fef861
dax/hmem: Request cxl_acpi and cxl_pci before walking Soft Reserved ranges

Ensure cxl_acpi has published CXL Window resources before HMEM walks Soft
Reserved ranges.

Replace MODULE_SOFTDEP("pre: cxl_acpi") with an explicit, synchronous
request_module("cxl_acpi"). MODULE_SOFTDEP() only guarantees eventual
loading, it does not enforce that the dependency has finished init
before the current module runs. This can cause HMEM to start before
cxl_acpi has populated the resource tree, breaking detection of overlaps
between Soft Reserved and CXL Windows.

Also, request cxl_pci before HMEM walks Soft Reserved ranges. Unlike
cxl_acpi, cxl_pci attach is asynchronous and creates dependent devices
that trigger further module loads. Asynchronous probe flushing
(wait_for_device_probe()) is added later in the series in a deferred
context before HMEM makes ownership decisions for Soft Reserved ranges.

Add an additional explicit Kconfig ordering so that CXL_ACPI and CXL_PCI
must be initialized before DEV_DAX_HMEM. This prevents HMEM from consuming
Soft Reserved ranges before CXL drivers have had a chance to claim them.

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>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Tomasz Wolski <tomasz.wolski@fujitsu.com>
Link: https://patch.msgid.link/20260322195343.206900-4-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/Kconfig
drivers/dax/hmem/hmem.c