Re: [PATCH v4 1/6] cxl/region: Warn on user region position mismatch

Jonathan Cameron <[email protected]>
Newsgroups org.kernel.vger.linux-cxl
Message-ID <20260821200127.60bef3fd@jic23-huawei>
On Thu, 20 Aug 2026 16:31:19 -0700
Alison Schofield <[email protected]> wrote:

> User region creation includes a self-test that checks the assigned
> endpoint positions against the position calculation used by auto
> region creation. A mismatch is reported with dev_dbg().
> 
> Promote that to a dev_warn() so bugs in the auto region position
> calculation are easier to catch as that calculation is extended to
> support more region configurations.
> 
> Signed-off-by: Alison Schofield <[email protected]>

Seems reasonable to me.
Reviewed-by: Jonathan Cameron <[email protected]>

> ---
> 
>  drivers/cxl/core/region.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 1e211542b6b6..3b640c9ba5a0 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -2218,10 +2218,10 @@ static int cxl_region_attach(struct cxl_region *cxlr,
>  		int test_pos;
>  
>  		test_pos = cxl_calc_interleave_pos(target, &cxlr->hpa_range);
> -		dev_dbg(&target->cxld.dev,
> -			"Test cxl_calc_interleave_pos(): %s test_pos:%d target->pos:%d\n",
> -			(test_pos == target->pos) ? "success" : "fail",
> -			test_pos, target->pos);
> +		if (test_pos != target->pos)
> +			dev_warn(&target->cxld.dev,
> +				 "position mismatch: calculated:%d programmed:%d\n",
> +				 test_pos, target->pos);
>  	}
>  
>  	return 0;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.