From: <dan.j.williams@intel.com>
To: Song Liu <song@kernel.org>, <dan.j.williams@intel.com>
Cc: Gregory Price <gourry@gourry.net>, <linux-cxl@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <kernel-team@meta.com>,
<dave@stgolabs.net>, <jonathan.cameron@huawei.com>,
<dave.jiang@intel.com>, <alison.schofield@intel.com>,
<vishal.l.verma@intel.com>, <ira.weiny@intel.com>
Subject: Re: [PATCH] cxl/acpi: fix CXL_ACPI=y + CXL_PMEM=m link failure
Date: Fri, 6 Mar 2026 17:33:17 -0800 [thread overview]
Message-ID: <69ab805da9dcf_6423c100f0@dwillia2-mobl4.notmuch> (raw)
In-Reply-To: <CAPhsuW7uE3J4+td=wLpJfiwSVbeyrF261in_yj3pudK9v6_o=Q@mail.gmail.com>
Song Liu wrote:
> On Thu, Mar 5, 2026 at 5:23 PM <dan.j.williams@intel.com> wrote:
> >
> > Gregory Price wrote:
> > > 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);
> >
> > I think we want this conflict to be resolved at build time. The nice
> > thing about a new CONFIG_CXL_ACPI_PMEM symbol is you can check your
> > config to find out why your CXL PMEM is not working. Otherwise,
> > IS_REACHABLE() hides this subtelty.
>
> Can we fix this with something like the following?
BTW, this is queued now:
https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git/commit/?h=fixes&id=93d0fcdddc9e
next prev parent reply other threads:[~2026-03-07 1:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 20:04 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 [this message]
2026-03-07 1:49 ` Song Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=69ab805da9dcf_6423c100f0@dwillia2-mobl4.notmuch \
--to=dan.j.williams@intel.com \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=gourry@gourry.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=kernel-team@meta.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=song@kernel.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®