[PATCH v2 2/2] cxl/acpi: Correct the add_cxl_resources() kernel-doc on a trimmed window

From: Unsung Lee

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


The kernel-doc says that when a System RAM range spans two CXL windows,
the tail of the second window is left for dynamic region provisioning.
pair_cxl_resource() only pairs a root decoder with a window that covers
its whole HPA range, so the root decoder of a trimmed window has never
had a resource, and no region can be created in that tail.

Describe what happens instead; region creation under such a decoder
now fails with -ENXIO. No functional change.

Signed-off-by: Unsung Lee <unsung0317@xxxxxxxxx>
---
drivers/cxl/acpi.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index 13609e2e98..bd04780a15 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -832,11 +832,14 @@ static void remove_cxl_resources(void *data)
* |-- "CXL Window 0" --||----- "CXL Window 1" -----|
* |--------------- "System RAM" -------------|
*
- * ...where platform firmware has established as System RAM resource across 2
- * windows, but has left some portion of window 1 for dynamic CXL region
- * provisioning. In this case "Window 0" will span the entirety of the "System
+ * ...where platform firmware has established a System RAM resource across 2
+ * windows. In this case "CXL Window 0" will span the entirety of the "System
* RAM" span, and "CXL Window 1" is truncated to the remaining tail past the end
- * of that "System RAM" resource.
+ * of that "System RAM" resource. The truncated window no longer covers the HPA
+ * range of its root decoder, so pair_cxl_resource() leaves that decoder
+ * without a resource and no region can be created under it. The same happens
+ * to the root decoder of a window that is removed because an expanded window
+ * contains it.
*/
static int add_cxl_resources(struct resource *cxl_res)
{
--
2.34.1