mirror-linux/tools
Li Ming d90f236f8b cxl/test: Update mock dev array before calling platform_device_add()
CXL test environment hits the following error sometimes.

 cxl_mem mem9: endpoint7 failed probe

All mock memdevs are platform firmware devices added by cxl_test module,
and cxl_test module also provides a platform device driver for them to
create a memdev device to CXL subsystem. cxl_test module uses
cxl_rcd/mem_single/mem arrays to store different types of mock memdevs.
CXL drivers calls registered mock functions for a mock memdev by
checking if a given memdev is in these arrays.

When cxl_test module adds these mock memdevs, it always calls
platform_device_add() before adding them to a suitable mock memdev
array. However, there is a small window where CXL drivers calls mock
function for a added memdev before it added to a mock memdev array. In
above case, cxl endpoint driver considers a added memdev was not a mock
memdev, then calling devm_cxl_endpoint_decoders_setup() for it rather
than mock_endpoint_decoders_setup().

An appropriate solution is that adding a new mock device to a mock
device array before calling platform_device_add() for it. It can
guarantee the new mock device is visible to CXL subsystem.

This patch introduces a new helped called cxl_mock_platform_device_add()
to handle the issue, and uses the function for all mock devices addition.

Fixes: 3a2b97b321 ("cxl/test: Improve init-order fidelity relative to real-world systems")
Signed-off-by: Li Ming <ming.li@zohomail.com>
Tested-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Link: https://patch.msgid.link/20260520121457.234404-1-ming.li@zohomail.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
2026-05-26 13:54:17 -07:00
..
accounting tools/accounting: handle truncated taskstats netlink messages 2026-04-15 02:15:02 -07:00
arch x86/CPU/AMD: Prevent improper isolation of shared resources in Zen2's op cache 2026-05-11 20:06:36 -07:00
bootconfig
bpf bpftool: add missing fsession to the usage and docs of bpftool 2026-04-12 12:42:38 -07:00
build perf tools updates for 7.1 2026-04-18 09:24:56 -07:00
certs
cgroup
counter
crypto
debugging
dma
docs docs: kdoc_diff: add a helper tool to help checking kdoc regressions 2026-03-30 10:54:13 -06:00
firewire
firmware
gpio
hv tools: hv: Fix cross-compilation 2026-04-14 04:43:26 +00:00
iio
include tools/headers: Regenerate stddef.h to fix BPF selftests 2026-05-02 09:37:44 -07:00
kvm/kvm_stat
laptop
leds
lib libbpf: fix off-by-one in emit_signature_match jump offset 2026-05-23 07:49:22 -07:00
memory-model
mm
net tools: ynl: support listening on all nsids 2026-05-21 08:23:50 -07:00
objtool objtool updates for v7.1: 2026-04-14 13:00:04 -07:00
pcmcia
perf perf trace: Update beautifier script for clone flags 2026-05-14 14:48:32 -07:00
power Power Utilities 2026.04.25 2026-04-25 16:58:34 -07:00
rcu
sched
sched_ext tools/sched_ext: scx_qmap: Silence task_ctx lookup miss 2026-04-21 06:18:58 -10:00
scripts Kbuild/Kconfig updates for 7.1 2026-04-14 09:18:40 -07:00
sound
spi
testing cxl/test: Update mock dev array before calling platform_device_add() 2026-05-26 13:54:17 -07:00
thermal
time
tracing RTLA patches for v7.1: 2026-04-15 17:48:24 -07:00
unittests docs: kdoc: better handle source when producing YAML output 2026-03-25 13:36:46 -06:00
usb usbip: tools: add hint when no exported devices are found 2026-04-11 12:02:00 +02:00
verification rv: Allow epoll in rtapp-sleep monitor 2026-04-01 15:18:30 +02:00
virtio
wmi
workqueue tools/workqueue: add CACHE_SHARD support to wq_dump.py 2026-04-01 10:24:18 -10:00
writeback
Makefile