]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/testing/cxl: Enable replay of user regions as auto regions
authorAlison Schofield <alison.schofield@intel.com>
Sat, 14 Mar 2026 06:19:50 +0000 (23:19 -0700)
committerDave Jiang <dave.jiang@intel.com>
Fri, 3 Apr 2026 18:45:48 +0000 (11:45 -0700)
commitf3b1d2260703f8fb39fd667a26d931d63d2dd10e
tree96f789e1305d244b63dc35c26c31d48d23580e59
parentd585bc86fb9f405ed1f2f56cc50c82d9aaada297
tools/testing/cxl: Enable replay of user regions as auto regions

The cxl_test module currently hard-codes auto regions in the mock
topology, limiting coverage of the driver's region auto-assembly
logic.

Teach cxl_test to replay previously committed decoder programming
across a cxl_acpi unbind/bind cycle. Decoder programming is recorded
in a registry keyed by a stable port identity and decoder id. The
registry is updated on decoder commit and reset events and consulted
during enumeration to restore previously enabled decoders.

This allows regions created through the user interface to be replayed
during enumeration and treated as auto-discovered regions, enabling
testing of region auto-assembly using configurations created in the
cxl_test topology.

Example workflow:
  # cxl create-region ...
  # echo 1 > /sys/bus/platform/devices/cxl_acpi.0/decoder_reset_preserve_registry
  # echo cxl_acpi.0 > /sys/bus/platform/drivers/cxl_acpi/unbind
  # echo cxl_acpi.0 > /sys/bus/platform/drivers/cxl_acpi/bind
  # echo 0 > /sys/bus/platform/devices/cxl_acpi.0/decoder_reset_preserve_registry

The NDCTL CXL unit test, cxl-region-replay.sh, demonstrates the usage.

Co-developed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Co-developed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Link: https://patch.msgid.link/20260314061952.2221030-1-alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
tools/testing/cxl/test/cxl.c