From: Dave Jiang <dave.jiang@intel.com>
To: linux-cxl@vger.kernel.org
Cc: dave@stgolabs.net, jonathan.cameron@huawei.com,
alison.schofield@intel.com, vishal.l.verma@intel.com,
ira.weiny@intel.com, dan.j.williams@intel.com
Subject: [PATCH 1/2] cxl/test: Removal of nvdimm_bus_register() wrapper in cxl_test
Date: Wed, 4 Feb 2026 17:16:32 -0700 [thread overview]
Message-ID: <20260205001633.1813643-2-dave.jiang@intel.com> (raw)
In-Reply-To: <20260205001633.1813643-1-dave.jiang@intel.com>
Remove nvdimm_bus_register() wrapper in cxl_test driver in order to
address a fix in a different commit that fixes the issue of missing
nvdimm bus object due to an initialization race. The CXL CLI unit
test cxl-security.sh will be adjusted with this new change.
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
drivers/cxl/pmem.c | 2 +-
include/linux/libnvdimm.h | 2 +-
tools/testing/cxl/Kbuild | 1 -
tools/testing/cxl/test/mock.c | 15 ---------------
4 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c
index e197883690ef..45486a9d23a5 100644
--- a/drivers/cxl/pmem.c
+++ b/drivers/cxl/pmem.c
@@ -334,7 +334,7 @@ static int cxl_nvdimm_bridge_probe(struct device *dev)
struct cxl_nvdimm_bridge *cxl_nvb = to_cxl_nvdimm_bridge(dev);
cxl_nvb->nd_desc = (struct nvdimm_bus_descriptor) {
- .provider_name = "CXL",
+ .provider_name = dev_name(dev->parent->parent),
.module = THIS_MODULE,
.ndctl = cxl_pmem_ctl,
};
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index 28f086c4a187..716163fc5e09 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -89,7 +89,7 @@ struct nvdimm_bus_descriptor {
unsigned long dimm_family_mask;
unsigned long bus_family_mask;
struct module *module;
- char *provider_name;
+ const char *provider_name;
struct device_node *of_node;
ndctl_fn ndctl;
int (*flush_probe)(struct nvdimm_bus_descriptor *nd_desc);
diff --git a/tools/testing/cxl/Kbuild b/tools/testing/cxl/Kbuild
index 0e151d0572d1..44abab0275e4 100644
--- a/tools/testing/cxl/Kbuild
+++ b/tools/testing/cxl/Kbuild
@@ -3,7 +3,6 @@ ldflags-y += --wrap=acpi_table_parse_cedt
ldflags-y += --wrap=is_acpi_device_node
ldflags-y += --wrap=acpi_evaluate_integer
ldflags-y += --wrap=acpi_pci_find_root
-ldflags-y += --wrap=nvdimm_bus_register
ldflags-y += --wrap=cxl_await_media_ready
ldflags-y += --wrap=devm_cxl_add_rch_dport
ldflags-y += --wrap=cxl_endpoint_parse_cdat
diff --git a/tools/testing/cxl/test/mock.c b/tools/testing/cxl/test/mock.c
index 44bce80ef3ff..47b1aadabf98 100644
--- a/tools/testing/cxl/test/mock.c
+++ b/tools/testing/cxl/test/mock.c
@@ -148,21 +148,6 @@ struct acpi_pci_root *__wrap_acpi_pci_find_root(acpi_handle handle)
}
EXPORT_SYMBOL_GPL(__wrap_acpi_pci_find_root);
-struct nvdimm_bus *
-__wrap_nvdimm_bus_register(struct device *dev,
- struct nvdimm_bus_descriptor *nd_desc)
-{
- int index;
- struct cxl_mock_ops *ops = get_cxl_mock_ops(&index);
-
- if (ops && ops->is_mock_dev(dev->parent->parent))
- nd_desc->provider_name = "cxl_test";
- put_cxl_mock_ops(index);
-
- return nvdimm_bus_register(dev, nd_desc);
-}
-EXPORT_SYMBOL_GPL(__wrap_nvdimm_bus_register);
-
int redirect_devm_cxl_switch_port_decoders_setup(struct cxl_port *port)
{
int rc, index;
--
2.52.0
next prev parent reply other threads:[~2026-02-05 0:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 0:16 [PATCH 0/2] cxl: Fix nvdimm_bus race for nvdimm_bridge Dave Jiang
2026-02-05 0:16 ` Dave Jiang [this message]
2026-02-09 19:30 ` [PATCH 1/2] cxl/test: Removal of nvdimm_bus_register() wrapper in cxl_test Ira Weiny
2026-02-05 0:16 ` [PATCH 2/2] cxl: Fix race of nvdimm_bus for the nvdimm_bridge object Dave Jiang
2026-02-05 6:44 ` kernel test robot
2026-02-05 17:47 ` kernel test robot
2026-02-05 21:28 ` [PATCH 0/2] cxl: Fix nvdimm_bus race for nvdimm_bridge Dave Jiang
2026-02-21 1:03 ` Alison Schofield
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=20260205001633.1813643-2-dave.jiang@intel.com \
--to=dave.jiang@intel.com \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.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