[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQltQuCZZ-eckUIQ@aschofie-mobl2.lan>
Date: Mon, 3 Nov 2025 19:04:34 -0800
From: Alison Schofield <alison.schofield@...el.com>
To: Robert Richter <rrichter@....com>
CC: Vishal Verma <vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>,
Dan Williams <dan.j.williams@...el.com>, Jonathan Cameron
<Jonathan.Cameron@...wei.com>, Dave Jiang <dave.jiang@...el.com>, "Davidlohr
Bueso" <dave@...olabs.net>, <linux-cxl@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Gregory Price <gourry@...rry.net>, "Fabio M.
De Francesco" <fabio.m.de.francesco@...ux.intel.com>, Terry Bowman
<terry.bowman@....com>, Joshua Hahn <joshua.hahnjy@...il.com>
Subject: Re: [PATCH v4 04/14] cxl/region: Add @hpa_range argument to function
cxl_calc_interleave_pos()
On Mon, Nov 03, 2025 at 07:47:45PM +0100, Robert Richter wrote:
> cxl_calc_interleave_pos() uses the endpoint decoder's HPA range to
> determine its interleaving position. This requires the endpoint
> decoders to be an SPA, which is not the case for systems that need
> address translation.
>
> Add a separate @hpa_range argument to function
> cxl_calc_interleave_pos() to specify the address range. Now it is
> possible to pass the SPA translated address range of an endpoint
> decoder to function cxl_calc_interleave_pos().
>
> Refactor only, no functional changes.
>
> Patch is a prerequisite to implement address translation.
>
> Reviewed-by: Gregory Price <gourry@...rry.net>
> Signed-off-by: Robert Richter <rrichter@....com>
> ---
> drivers/cxl/core/region.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
snip
> @@ -2094,7 +2095,7 @@ static int cxl_region_attach(struct cxl_region *cxlr,
> struct cxl_endpoint_decoder *cxled = p->targets[i];
> int test_pos;
>
> - test_pos = cxl_calc_interleave_pos(cxled);
> + test_pos = cxl_calc_interleave_pos(cxled, &cxlr->hpa_range);
This is accessing the new hpa_range that Patch 2/14 started storing in
struct cxl_region. It stores it only for auto-regions and this is
a user created region path.
So the fixup is actually in Patch 2 - but this is the why. It shows
up as a bunch of dev_errs() from find_pos_and_ways() running unit
tests that create regions.
> dev_dbg(&cxled->cxld.dev,
> "Test cxl_calc_interleave_pos(): %s test_pos:%d cxled->pos:%d\n",
> (test_pos == cxled->pos) ? "success" : "fail",
> --
> 2.47.3
>
Powered by blists - more mailing lists