public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cxl/acpi: fix CXL_ACPI=y + CXL_PMEM=m link failure
@ 2026-03-02 20:04 Gregory Price
  2026-03-03  9:06 ` Harshit Mogalapalli
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Gregory Price @ 2026-03-02 20:04 UTC (permalink / raw)
  To: linux-cxl
  Cc: linux-kernel, kernel-team, dave, jonathan.cameron, dave.jiang,
	alison.schofield, vishal.l.verma, ira.weiny, dan.j.williams

Commit e7e222ad73d9 ("cxl: Move devm_cxl_add_nvdimm_bridge() to
cxl_pmem.ko") moved devm_cxl_add_nvdimm_bridge() from cxl_core into
cxl_pmem, creating a symbol dependency from cxl_acpi to cxl_pmem.

When CXL_ACPI=y and CXL_PMEM=m, the built-in cxl_acpi attempts to
link against a non-built-in cxl_pmem, which the linker cannot resolve.

CXL_PMEM depends on LIBNVDIMM, so LIBNVDIMM=m constrains CXL_PMEM to
at most =m.

Change IS_ENABLED() to IS_REACHABLE(), which returns false when a
built-in caller references a modular target, preventing the link error.

The result is if the pmem/nvdimm symbols are not reachable at build
time, then at runtime it will always return -ENODEV.

Fixes: e7e222ad73d9 ("cxl: Move devm_cxl_add_nvdimm_bridge() to cxl_pmem.ko")
Signed-off-by: Gregory Price <gourry@gourry.net>
---
 drivers/cxl/acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index 127537628817..7065413eda9f 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -952,7 +952,7 @@ static int cxl_acpi_probe(struct platform_device *pdev)
 	if (rc < 0)
 		return rc;
 
-	if (IS_ENABLED(CONFIG_CXL_PMEM))
+	if (IS_REACHABLE(CONFIG_CXL_PMEM))
 		rc = device_for_each_child(&root_port->dev, root_port,
 					   add_root_nvdimm_bridge);
 	if (rc < 0)
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-03-07  1:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 20:04 [PATCH] cxl/acpi: fix CXL_ACPI=y + CXL_PMEM=m link failure Gregory Price
2026-03-03  9:06 ` Harshit Mogalapalli
2026-03-03 10:13 ` Jonathan Cameron
2026-03-03 15:21   ` Gregory Price
2026-03-06  1:23 ` dan.j.williams
2026-03-06 22:18   ` Song Liu
2026-03-07  1:33     ` dan.j.williams
2026-03-07  1:49       ` Song Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox