From: Li Chen <me@linux.beauty>
To: Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Terry Bowman <terry.bowman@amd.com>, Kees Cook <kees@kernel.org>,
linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Li Chen <me@linux.beauty>
Subject: [PATCH v1] cxl/pmem: Defer nvdimm bridge attachment failures
Date: Wed, 25 Mar 2026 14:20:47 +0800 [thread overview]
Message-ID: <20260325062051.3777413-1-me@linux.beauty> (raw)
cxl_acpi is initialized before cxl_pmem registers
cxl_nvdimm_bridge_driver when both are built in.
__devm_cxl_add_nvdimm_bridge() creates the nvdimm bridge
device and immediately checks whether a driver bound to it.
At that point the device may already exist while the bridge
driver is not registered, or has not bound yet, so
dev->driver == NULL
is only a temporary state rather than a permanent -ENODEV
failure.
Treating that state as fatal makes cxl_acpi probe fail, so
the root CXL topology never becomes visible to userspace and
region creation later reports no active memdevs.
Return -EPROBE_DEFER instead so cxl_acpi retries after
cxl_nvdimm_bridge_driver is registered.
Signed-off-by: Li Chen <me@linux.beauty>
---
drivers/cxl/core/pmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cxl/core/pmem.c b/drivers/cxl/core/pmem.c
index 68462e38a977..a213eb074814 100644
--- a/drivers/cxl/core/pmem.c
+++ b/drivers/cxl/core/pmem.c
@@ -149,7 +149,7 @@ struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,
if (cxl_nvdimm_bridge_failed_attach(cxl_nvb)) {
unregister_nvb(cxl_nvb);
- return ERR_PTR(-ENODEV);
+ return ERR_PTR(-EPROBE_DEFER);
}
rc = devm_add_action_or_reset(host, unregister_nvb, cxl_nvb);
--
2.52.0
next reply other threads:[~2026-03-25 6:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 6:20 Li Chen [this message]
2026-04-11 20:51 ` Dan Williams
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=20260325062051.3777413-1-me@linux.beauty \
--to=me@linux.beauty \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=kees@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=terry.bowman@amd.com \
--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®