Re: [PATCH v9 02/13] cxl/region: Store root decoder in struct cxl_region

From: Alison Schofield

Date: Tue Jan 13 2026 - 22:13:35 EST


On Sat, Jan 10, 2026 at 12:46:47PM +0100, 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 the code by removing dynamic lookups and 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. It changes the argument list of __construct_region() in
> preparation of adding a context argument. Additionally the arg list of
> cxl_region_attach_position() is simplified and the use of
> to_cxl_root_decoder() removed, which always reconstructs and checks
> the pointer. The pointer never changes and is frequently used. Code
> becomes more readable as this amphazises the binding between both
> objects.

Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>