summaryrefslogtreecommitdiff
path: root/tools/testing/cxl
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2023-06-22 15:54:59 -0500
committerDan Williams <dan.j.williams@intel.com>2023-06-25 11:35:26 -0700
commit0619337856c9a1cb999417be38c4049a6b0235a0 (patch)
tree1446bbea8ddf7dff29eab3a2fd5982ea846d0876 /tools/testing/cxl
parenteb4663b07e13bc138aad9e2a93ee9893c7139f51 (diff)
cxl/rch: Prepare for caching the MMIO mapped PCIe AER capability
Prepare cxl_probe_rcrb() for retrieving more than just the component register block. The RCH AER handling code wants to get back to the AER capability that happens to be MMIO mapped rather then configuration cycles. Move RCRB specific downstream port data, like the RCRB base and the AER capability offset, into its own data structure ('struct cxl_rcrb_info') for cxl_probe_rcrb() to fill. Extend 'struct cxl_dport' to include a 'struct cxl_rcrb_info' attribute. This centralizes all RCRB scanning in one routine. Co-developed-by: Robert Richter <rrichter@amd.com> 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-4-terry.bowman@amd.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools/testing/cxl')
-rw-r--r--tools/testing/cxl/test/mock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/cxl/test/mock.c b/tools/testing/cxl/test/mock.c
index 30119a16ae85..dbeef5c6f606 100644
--- a/tools/testing/cxl/test/mock.c
+++ b/tools/testing/cxl/test/mock.c
@@ -271,8 +271,10 @@ struct cxl_dport *__wrap_devm_cxl_add_rch_dport(struct cxl_port *port,
if (ops && ops->is_mock_port(dport_dev)) {
dport = devm_cxl_add_dport(port, dport_dev, port_id,
CXL_RESOURCE_NONE);
- if (!IS_ERR(dport))
+ if (!IS_ERR(dport)) {
+ dport->rcrb.base = rcrb;
dport->rch = true;
+ }
} else
dport = devm_cxl_add_rch_dport(port, dport_dev, port_id, rcrb);
put_cxl_mock_ops(index);