Skip to content

Commit 86917c5

Browse files
Robert Richterdjbw
authored andcommitted
cxl/mem: Prepare for early RCH dport component register setup
In order to move the RCH dport component register setup to cxl_pci the base address must be stored in CXL device state (cxlds) for both modes, RCH and VH. Store it in cxlds->component_reg_phys and use it for endpoint creation. Signed-off-by: Robert Richter <rrichter@amd.com> Signed-off-by: Terry Bowman <terry.bowman@amd.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230622205523.85375-13-terry.bowman@amd.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent f1d0525 commit 86917c5

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/cxl/mem.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static int devm_cxl_add_endpoint(struct device *host, struct cxl_memdev *cxlmd,
5151
struct cxl_port *parent_port = parent_dport->port;
5252
struct cxl_dev_state *cxlds = cxlmd->cxlds;
5353
struct cxl_port *endpoint, *iter, *down;
54-
resource_size_t component_reg_phys;
5554
int rc;
5655

5756
/*
@@ -72,11 +71,11 @@ static int devm_cxl_add_endpoint(struct device *host, struct cxl_memdev *cxlmd,
7271
* typical register locator mechanism.
7372
*/
7473
if (parent_dport->rch && cxlds->component_reg_phys == CXL_RESOURCE_NONE)
75-
component_reg_phys =
74+
cxlds->component_reg_phys =
7675
cxl_rcd_component_reg_phys(&cxlmd->dev, parent_dport);
77-
else
78-
component_reg_phys = cxlds->component_reg_phys;
79-
endpoint = devm_cxl_add_port(host, &cxlmd->dev, component_reg_phys,
76+
77+
endpoint = devm_cxl_add_port(host, &cxlmd->dev,
78+
cxlds->component_reg_phys,
8079
parent_dport);
8180
if (IS_ERR(endpoint))
8281
return PTR_ERR(endpoint);

0 commit comments

Comments
 (0)