Re: [PATCH v8 2/4] cxl/region: Don't leak tolerated RAM -EFAULT from unmapped poison scan

From: Jonathan Cameron

Date: Fri Sep 25 2026 - 19:18:40 EST


On Tue, 22 Sep 2026 18:11:27 +0800
Richard Cheng <icheng@xxxxxxxxxx> wrote:

> CXL 3.0 section 8.2.9.8.4.1 requires Get Poison List to return Invalid
> Physical Address for a volatile range when the device does not support
> volatile poison lists.
>
> For example, consider a memdev with a single RAM partition and a
> committed decoder covering only part of it:
>
> RAM partition: [ committed decoder ][ unmapped tail ]
>
> On a device without volatile poison-list support, querying this tail
> returns Invalid Physical Address, which cxl_internal_send_cmd() maps
> to -EFAULT. The driver tolerates this response for RAM because volatile
> poison-list support is optional.
>
> When cxl_get_poison_unmapped() was converted to iterate over partitions,
> the RAM-specific error handling became a continue without clearing rc.
> If no subsequent query overwrites rc, the function returns the tolerated
> -EFAULT and incorrectly reports the enumeration as failed.
>
> Clear rc before continuing, restoring the previous handling of this
> expected response for RAM partitions.
>
> Fixes: be5cbd0840275 ("cxl: Kill enum cxl_decoder_mode")
> Reviewed-by: Dave Jiang <dave.jiang@xxxxxxxxx>
> Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>
> Signed-off-by: Richard Cheng <icheng@xxxxxxxxxx>
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>