summaryrefslogtreecommitdiffstats
path: root/tools/testing/cxl/test/cxl.c
diff options
context:
space:
mode:
authorAlison Schofield <alison.schofield@intel.com>2023-10-25 13:01:34 -0700
committerDan Williams <dan.j.williams@intel.com>2023-10-27 13:04:51 -0700
commit0cf36a85c1408f86a967fb1db721de1b89b9e675 (patch)
treee29fe150561f7e41f823837585642588a0016088 /tools/testing/cxl/test/cxl.c
parenta3e00c964fb943934af916f48f0dd43b5110c866 (diff)
downloadlinux-stable-0cf36a85c1408f86a967fb1db721de1b89b9e675.tar.gz
linux-stable-0cf36a85c1408f86a967fb1db721de1b89b9e675.tar.bz2
linux-stable-0cf36a85c1408f86a967fb1db721de1b89b9e675.zip
cxl/region: Use cxl_calc_interleave_pos() for auto-discovery
For auto-discovered regions the driver must assign each target to a valid position in the region interleave set based on the decoder topology. The current implementation fails to parse valid decode topologies, as it does not consider the child offset into a parent port. The sort put all targets of one port ahead of another port when an interleave was expected, causing the region assembly to fail. Replace the existing relative sort with cxl_calc_interleave_pos() that finds the exact position in a region interleave for an endpoint based on a walk up the ancestral tree from endpoint to root decoder. cxl_calc_interleave_pos() was introduced in a prior patch, so the work here is to use it in cxl_region_sort_targets(). Remove the obsoleted helper functions from the prior sort. Testing passes on pre-production hardware with BIOS defined regions that natively trigger this autodiscovery path of the region driver. Testing passes a CXL unit test using the dev_dbg() calculation test (see cxl_region_attach()) across an expanded set of region configs: 1, 1, 1+1, 1+1+1, 2, 2+2, 2+2+2, 2+2+2+2, 4, 4+4, where each number represents the count of endpoints per host bridge. Fixes: a32320b71f08 ("cxl/region: Add region autodiscovery") Reported-by: Dmytro Adamenko <dmytro.adamenko@intel.com> Signed-off-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com> Link: https://lore.kernel.org/r/3946cc55ddc19678733eddc9de2c317749f43f3b.1698263080.git.alison.schofield@intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools/testing/cxl/test/cxl.c')
0 files changed, 0 insertions, 0 deletions