Skip to content

Commit 87439b5

Browse files
committed
cxl/test: Setup target_map for cxl_test decoder initialization
cxl_test uses mock functions for decoder enumaration. Add initialization of the cxld->target_map[] for cxl_test based decoders in the mock functions. Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Tested-by: Robert Richter <rrichter@amd.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent 644685a commit 87439b5

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • tools/testing/cxl/test

tools/testing/cxl/test/cxl.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,15 +811,21 @@ static void mock_init_hdm_decoder(struct cxl_decoder *cxld)
811811
*/
812812
if (WARN_ON(!dev))
813813
continue;
814+
814815
cxlsd = to_cxl_switch_decoder(dev);
815816
if (i == 0) {
816817
/* put cxl_mem.4 second in the decode order */
817-
if (pdev->id == 4)
818+
if (pdev->id == 4) {
818819
cxlsd->target[1] = dport;
819-
else
820+
cxld->target_map[1] = dport->port_id;
821+
} else {
820822
cxlsd->target[0] = dport;
821-
} else
823+
cxld->target_map[0] = dport->port_id;
824+
}
825+
} else {
822826
cxlsd->target[0] = dport;
827+
cxld->target_map[0] = dport->port_id;
828+
}
823829
cxld = &cxlsd->cxld;
824830
cxld->target_type = CXL_DECODER_HOSTONLYMEM;
825831
cxld->flags = CXL_DECODER_F_ENABLE;

0 commit comments

Comments
 (0)