Re: [PATCH v3 01/11] cxl/region: Store root decoder in struct cxl_region
From: Robert Richter
Date: Fri Sep 26 2025 - 13:52:43 EST
On 23.09.25 14:40:31, Alison Schofield wrote:
> On Fri, Sep 12, 2025 at 04:45:03PM +0200, Robert Richter wrote:
> > A region is always bound to a root decoder. The region's associated
> > root decoder is often needed. Add it to struct cxl_region.
> >
> > This simplifies code by removing dynamic lookups and removing the root
> > decoder argument from the function argument list where possible.
> >
> > Patch is a prerequisite to implement address translation which uses
> > struct cxl_region to store all relevant region and interleaving
> > parameters.
>
> Where is the follow on patch that makes this a prerequisite?
I changed this to simplify and rework the argument list of
__construct_region(cxlr, cxled). Later, this changes further to use a
context argument: __construct_region(cxlr, ctx).
The patch additionally simplifies the arg list of
cxl_region_attach_position() and it removes the use of
to_cxl_root_decoder() which always reconstructs and checks the
pointer. The pointer never changes and is frequently used. Also, code
becomes more readable as this amphazises the binding between both
objects. Overall, I don't see a reason to use to_cxl_root_decoder() as
an alternative to avoid the the pointer, which would generally be
possible.
I will update the description accordingly.
Thanks,
-Robert