Re: [PATCH 2/3] cxl/region: Scan all partitions for unmapped poison

From: Alison Schofield

Date: Wed Jul 01 2026 - 00:48:53 EST


On Tue, Jun 30, 2026 at 03:46:56PM +0800, Richard Cheng wrote:
> cxl_get_poison_unmapped() sweeps the unmapped tail of each partition
> from ctx->part onward. A fully-mapped partition has no unmapped tail
> , it's a normal per-partition state, but the loop treated it with break,
> aborting the whole sweep and silently skipping unmapped poison in all
> later partition. Use continue so a fully-mapped partition is skipped and
> later partitions are still scanned.

Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>
Tested-by: Alison Schofield <alison.schofield@xxxxxxxxx>

Posted a test case for review:
https://lore.kernel.org/all/20260701044205.1589967-1-alison.schofield@xxxxxxxxx/



>
> Fixes: be5cbd0840275 ("cxl: Kill enum cxl_decoder_mode")
> Signed-off-by: Richard Cheng <icheng@xxxxxxxxxx>
> ---
> drivers/cxl/core/region.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 1e211542b6b6..be246fb09c99 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -2931,7 +2931,7 @@ static int cxl_get_poison_unmapped(struct cxl_memdev *cxlmd,
> offset = res->start;
> length = res->end - offset + 1;
> if (!length)
> - break;
> + continue;
> rc = cxl_mem_get_poison(cxlmd, offset, length, NULL);
> if (rc == -EFAULT && cxlds->part[i].mode == CXL_PARTMODE_RAM)
> continue;
> --
> 2.43.0
>
>