Skip to content

Commit a3a9687

Browse files
Robert Richterdavejiang
authored andcommitted
cxl/region: Rename function to cxl_port_pick_region_decoder()
Current function cxl_region_find_decoder() is used to find a port's decoder during region setup. In the region creation path the function is an allocator to find a free port. In the region assembly path, it is recalling the decoder that platform firmware picked for validation purposes. Rename function to cxl_port_pick_region_decoder() that better describes its use and update the function's description. The result of cxl_port_pick_region_decoder() is recorded in a 'struct cxl_region_ref' in @PORT for later recall when other endpoints might also be targets of the picked decoder. Signed-off-by: Robert Richter <[email protected]> Reviewed-by: Gregory Price <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Reviewed-by: "Fabio M. De Francesco" <[email protected]> Tested-by: Gregory Price <[email protected]> Acked-by: Dan Williams <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent 99ff906 commit a3a9687

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

drivers/cxl/core/region.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,23 @@ static int match_auto_decoder(struct device *dev, const void *data)
864864
return 0;
865865
}
866866

867+
/**
868+
* cxl_port_pick_region_decoder() - assign or lookup a decoder for a region
869+
* @port: a port in the ancestry of the endpoint implied by @cxled
870+
* @cxled: endpoint decoder to be, or currently, mapped by @port
871+
* @cxlr: region to establish, or validate, decode @port
872+
*
873+
* In the region creation path cxl_port_pick_region_decoder() is an
874+
* allocator to find a free port. In the region assembly path, it is
875+
* recalling the decoder that platform firmware picked for validation
876+
* purposes.
877+
*
878+
* The result is recorded in a 'struct cxl_region_ref' in @port.
879+
*/
867880
static struct cxl_decoder *
868-
cxl_region_find_decoder(struct cxl_port *port,
869-
struct cxl_endpoint_decoder *cxled,
870-
struct cxl_region *cxlr)
881+
cxl_port_pick_region_decoder(struct cxl_port *port,
882+
struct cxl_endpoint_decoder *cxled,
883+
struct cxl_region *cxlr)
871884
{
872885
struct device *dev;
873886

@@ -931,7 +944,7 @@ alloc_region_ref(struct cxl_port *port, struct cxl_region *cxlr,
931944
if (test_bit(CXL_REGION_F_AUTO, &cxlr->flags)) {
932945
struct cxl_decoder *cxld;
933946

934-
cxld = cxl_region_find_decoder(port, cxled, cxlr);
947+
cxld = cxl_port_pick_region_decoder(port, cxled, cxlr);
935948
if (auto_order_ok(port, iter->region, cxld))
936949
continue;
937950
}
@@ -1019,7 +1032,7 @@ static int cxl_rr_alloc_decoder(struct cxl_port *port, struct cxl_region *cxlr,
10191032
{
10201033
struct cxl_decoder *cxld;
10211034

1022-
cxld = cxl_region_find_decoder(port, cxled, cxlr);
1035+
cxld = cxl_port_pick_region_decoder(port, cxled, cxlr);
10231036
if (!cxld) {
10241037
dev_dbg(&cxlr->dev, "%s: no decoder available\n",
10251038
dev_name(&port->dev));

0 commit comments

Comments
 (0)