]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cxl/region: Store root decoder in struct cxl_region
authorRobert Richter <rrichter@amd.com>
Wed, 14 Jan 2026 16:48:18 +0000 (17:48 +0100)
committerDave Jiang <dave.jiang@intel.com>
Tue, 3 Feb 2026 17:52:56 +0000 (10:52 -0700)
commit4fe82279580d10ba63c1461ff404f2c6c82ff1d5
treebdf58319cbcfe2809af495d40af28d8c1a0a0b78
parentdf8b57c34b47e0acbe1133ca58ac75ec3c56771f
cxl/region: Store root decoder in struct cxl_region

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: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Robert Richter <rrichter@amd.com>
Link: https://patch.msgid.link/20260114164837.1076338-3-rrichter@amd.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/region.c
drivers/cxl/cxl.h