[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aNbZ5SgeOAJUhTR0@rric.localdomain>
Date: Fri, 26 Sep 2025 20:22:29 +0200
From: Robert Richter <rrichter@....com>
To: Alison Schofield <alison.schofield@...el.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 v3 05/11] cxl/region: Add @range argument to function
cxl_calc_interleave_pos()
On 23.09.25 14:52:04, Alison Schofield wrote:
> On Fri, Sep 12, 2025 at 04:45:07PM +0200, 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 @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().
> >
> > Patch is a prerequisite to implement address translation.
> >
> > Signed-off-by: Robert Richter <rrichter@....com>
> > ---
> > 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 8ccc171ac724..106692f1e310 100644
> > --- a/drivers/cxl/core/region.c
> > +++ b/drivers/cxl/core/region.c
> > @@ -1844,11 +1844,11 @@ static int find_pos_and_ways(struct cxl_port *port, struct range *range,
> > * Return: position >= 0 on success
> > * -ENXIO on failure
> > */
> > -static int cxl_calc_interleave_pos(struct cxl_endpoint_decoder *cxled)
> > +static int cxl_calc_interleave_pos(struct cxl_endpoint_decoder *cxled,
> > + struct range *range)
> > {
> > struct cxl_port *iter, *port = cxled_to_port(cxled);
> > struct cxl_memdev *cxlmd = cxled_to_memdev(cxled);
> > - struct range *range = &cxled->cxld.hpa_range;
> > int parent_ways = 0, parent_pos = 0, pos = 0;
> > int rc;
>
> Will this work? Change the assignment rather than adding a parameter:
>
> - struct range *range = &cxled->cxld.hpa_range;
> + struct range *range = &cxled->cxld.region->hpa_range;
For cxl_region_sort_targets() it doesn't as the region is not yet
attached. This is the calling order:
cxl_region_sort_targets
cxl_calc_interleave_pos
# needs cxlr->hpa_range
cxl_region_attach_position
...
cxld->region = cxlr;
It would be nice if we can make this work and drop the argument. Will
take a look.
Thanks,
-Robert
Powered by blists - more mailing lists