]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cxl/region: Use region data to get the root decoder
authorRobert Richter <rrichter@amd.com>
Wed, 14 Jan 2026 16:48:23 +0000 (17:48 +0100)
committerDave Jiang <dave.jiang@intel.com>
Tue, 3 Feb 2026 17:52:58 +0000 (10:52 -0700)
commitd01149bbe76d81d360ed24853d5247fcaad873e4
treef0ca4c1e5864e1afbf7e74c321e185a742702b69
parent1fd6c38fc5e18a9904bc1bd447bb4c2708f0292d
cxl/region: Use region data to get the root decoder

To find a region's root decoder, the endpoint's HPA range is used to
search the matching decoder by its range. With address translation the
endpoint decoder's range is in a different address space and thus
cannot be used to determine the root decoder.

The region parameters are encapsulated within struct cxl_region_context
and may include the translated Host Physical Address (HPA) range. Use
this context to identify the root decoder rather than relying on the
endpoint.

Modify cxl_find_root_decoder() and add the region context as
parameter. Rename this function to get_cxl_root_decoder() as a
counterpart to put_cxl_root_decoder(). Simplify the implementation by
removing function cxl_port_find_switch_decode(). The function is
unnecessary because it is not referenced or utilized elsewhere in the
code.

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