summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2026-08-05 13:23:52 -0700
committerDave Jiang <dave.jiang@intel.com>2026-08-05 13:23:52 -0700
commit5d109da47693aa49929d5abb921d38ef2bceb7d0 (patch)
tree9ad741c4ef0836ff9d3255370c9dbb4d0fe30691 /tools
parent212e015fc34712c849653cdb3179cd643c915015 (diff)
parent94d84e3d89594f6ad6dc5ed5bed05956bf146149 (diff)
Merge branch 'for-7.3/cxl-misc' into cxl-for-next
cxl/test: Assign one mock memdev a full-width serial number cxl/core: Format the memdev serial number as unsigned in TP_printk cxl/pmem: Format the nvdimm serial number as unsigned decimal
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/cxl/test/mem.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c
index a7da279aa3ef..7b756000a1a6 100644
--- a/tools/testing/cxl/test/mem.c
+++ b/tools/testing/cxl/test/mem.c
@@ -1713,6 +1713,7 @@ static int cxl_mock_mem_probe(struct platform_device *pdev)
struct cxl_mockmem_data *mdata;
struct cxl_mailbox *cxl_mbox;
struct cxl_dpa_info range_info = { 0 };
+ u64 serial;
int rc;
/* Increase async probe race window */
@@ -1739,7 +1740,19 @@ static int cxl_mock_mem_probe(struct platform_device *pdev)
if (rc)
return rc;
- mds = cxl_memdev_state_create(dev, pdev->id + 1, 0);
+ /*
+ * Mock serials have historically been derived from pdev->id and stayed
+ * single-digit, so they never exercised either decimal-vs-hex key
+ * lookup or unsigned formatting. Give one mock device a full-width
+ * serial with bit 63 set, matching real hardware such as Montage CXL
+ * devices. pdev->id 7 is unused by the auto-region topology.
+ */
+ if (pdev->id == 7)
+ serial = 0x8a34567890abcdef;
+ else
+ serial = pdev->id + 1;
+
+ mds = cxl_memdev_state_create(dev, serial, 0);
if (IS_ERR(mds))
return PTR_ERR(mds);