[PATCH v9 0/4] cxl: Repair poison enumeration regressions

From: Richard Cheng

Date: Tue Oct 20 2026 - 01:14:26 EST


This series repairs four poison enumeration regressions introduced by
commit be5cbd084027 ("cxl: Kill enum cxl_decoder_mode"). This revision
rebases the four patches from v8 [1] onto Linus's v7.3 tag and
incorporates the review feedback.

Patch 1: cxl_get_poison_unmapped() ends the partition walk when it
encounters a fully mapped partition. Continue to the next partition
instead, so unmapped poison in later partitions is still collected.

Patch 2: the unmapped scan tolerates -EFAULT for RAM partitions but
leaves the error in rc. If no later query overwrites rc, enumeration
incorrectly reports failure. Clear rc before continuing past the
tolerated error.

Patch 3: use the ctx->offset handoff from the committed-decoder walk
as the starting point for the unmapped scan. Starting after the highest
DPA allocation leaves ranges allocated to uncommitted decoders
unqueried. Resume at the committed boundary and scan later partitions
from their beginning. Also reset both the partition and offset when
falling back to scanning all partitions, as suggested by Alison.

Patch 4: cxl_get_poison_by_memdev() can overwrite an earlier partition
query failure with a later success. Stop on the first error that is
not already tolerated as a RAM -EFAULT, preserving the failure.
Introduce a shared poison_efault_forgiven() helper in core.h and use
it in the memdev and region poison paths, as suggested by Davidlohr.


Changes since v8 [1]:
- Rebase onto Linus's v7.3 tag
- Keep patches 1 and 2 functionally unchanged
- Patch 3: Reset ctx.offset and ctx.part, suggested by Alison Schofield
- Patch 4: Introduce poison_efault_forgiven(), suggested by
Davidlohr Bueso.
The helper was present on v8's base but absent from v7.3

Best regards,
Richard Cheng.


Richard Cheng (4):
cxl/region: Scan all partitions for unmapped poison
cxl/region: Don't leak tolerated RAM -EFAULT from unmapped poison scan
cxl/region: Start unmapped poison scan at the committed decoder
boundary
cxl/memdev: Don't overwrite the error from an earlier partition poison
query

drivers/cxl/core/core.h | 9 +++++++++
drivers/cxl/core/memdev.c | 8 +++-----
drivers/cxl/core/region.c | 24 ++++++++++++++----------
3 files changed, 26 insertions(+), 15 deletions(-)


base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
--
2.43.0