[PATCH v2 0/2] cxl: Fail region creation for a root decoder without a CXL window

From: Unsung Lee

Date: Fri Dec 04 2026 - 08:58:07 EST


When add_cxl_resources() trims or removes a CXL window, the window's
root decoder stays registered without a resource, and creating a region
under it oopses. Patch 1 rejects region creation for such a decoder and
logs the decoder when it is left unpaired. Patch 2 corrects the
add_cxl_resources() kernel-doc.

On the kernel-doc question: the trimmed tail is not usable, and has not
been since pair_cxl_resource() was added in 0f157c7fa1a0, because a
root decoder is only paired with a window that covers its whole HPA
range. Making the tail usable would need a different pairing and HPA
allocation, which is beyond this fix, so patch 2 changes the comment to
match the code.

Changes since v1:
- Shortened the commit message; setup details moved below --- (Alison)
- dev_dbg() for a root decoder left without a window (Alison)
- New patch 2 for the kernel-doc (Alison)
- Rebased on cxl/next 5ee57f66c2

Test details are below the --- line in patch 1.

An AI coding assistant was used to analyze the bug, draft changelogs,
and automate the QEMU testing. I reviewed the text and the results.

v1: https://lore.kernel.org/linux-cxl/20261121105714.1542859-1-unsung0317@xxxxxxxxx/

Unsung Lee (2):
cxl/region: Fail region creation for a root decoder without a CXL
window
cxl/acpi: Correct the add_cxl_resources() kernel-doc on a trimmed
window

drivers/cxl/acpi.c | 18 ++++++++++++++----
drivers/cxl/core/region.c | 2 +-
2 files changed, 15 insertions(+), 5 deletions(-)


base-commit: 5ee57f66c2cc4565b35967ef64a02de2df1fe0ab
--
2.34.1