]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cxl/region: Factor out code to find a root decoder's region
authorRobert Richter <rrichter@amd.com>
Fri, 9 May 2025 15:06:55 +0000 (17:06 +0200)
committerDave Jiang <dave.jiang@intel.com>
Fri, 9 May 2025 16:57:29 +0000 (09:57 -0700)
commit868a8f1f045bce791c3123845075ee9a82a9fe4c
tree5ca7e999a0402ff586723fced603566bd92dc061
parent9466ee981647a8655e7f8312ae89aba665d78918
cxl/region: Factor out code to find a root decoder's region

In function cxl_add_to_region() there is code to determine a root
decoder's region. Factor that code out. This is in preparation to
further rework and simplify function cxl_add_to_region().

The reference count must be decremented after using the region.
cxl_find_region_by_range() is paired with the put_cxl_region cleanup
helper that can be used for this.

[dj: Fixed up "obj __free(...) = NULL" pattern]

Signed-off-by: Robert Richter <rrichter@amd.com>
Reviewed-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: "Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>
Tested-by: Gregory Price <gourry@gourry.net>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Link: https://patch.msgid.link/20250509150700.2817697-11-rrichter@amd.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/region.c
drivers/cxl/cxl.h