]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dax/cxl: Fix HMEM dependencies
authorDan Williams <dan.j.williams@intel.com>
Fri, 27 Mar 2026 05:28:14 +0000 (22:28 -0700)
committerDave Jiang <dave.jiang@intel.com>
Wed, 1 Apr 2026 15:12:17 +0000 (08:12 -0700)
The expectation is that DEV_DAX_HMEM=y should be disallowed if any of
CXL_ACPI, or CXL_PCI are set =m. Also DEV_DAX_CXL=y should be disallowed if
DEV_DAX_HMEM=m. Use "$config || !$config" syntax for each dependency.
Otherwise, the invalid DEV_DAX_HMEM=m && DEV_DAX_CXL=y configuration is
allowed.

Lastly, dax_hmem depends on the availability of the
cxl_region_contains_resource() symbol published by the cxl_core.ko module.
So, also prevent DEV_DAX_HMEM from being built-in when the cxl_core module
is not built-in.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260327052821.440749-3-dan.j.williams@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/dax/Kconfig

index 3683bb3f2311bcaa47f0f548a8abc3fdc33c88c9..504f7f735ef5fa8dc45affe28194351ee099ed22 100644 (file)
@@ -32,6 +32,9 @@ config DEV_DAX_HMEM
        depends on EFI_SOFT_RESERVE
        select NUMA_KEEP_MEMINFO if NUMA_MEMBLKS
        default DEV_DAX
+       depends on CXL_ACPI || !CXL_ACPI
+       depends on CXL_PCI || !CXL_PCI
+       depends on CXL_BUS || !CXL_BUS
        help
          EFI 2.8 platforms, and others, may advertise 'specific purpose'
          memory. For example, a high bandwidth memory pool. The
@@ -48,8 +51,7 @@ config DEV_DAX_CXL
        tristate "CXL DAX: direct access to CXL RAM regions"
        depends on CXL_BUS && CXL_REGION && DEV_DAX
        default CXL_REGION && DEV_DAX
-       depends on CXL_ACPI >= DEV_DAX_HMEM
-       depends on CXL_PCI >= DEV_DAX_HMEM
+       depends on DEV_DAX_HMEM || !DEV_DAX_HMEM
        help
          CXL RAM regions are either mapped by platform-firmware
          and published in the initial system-memory map as "System RAM", mapped