Commit 711442e2 authored by Dan Williams's avatar Dan Williams

cxl/region: Fix passthrough-decoder detection

A passthrough decoder is a decoder that maps only 1 target. It is a
special case because it does not impose any constraints on the
interleave-math as compared to a decoder with multiple targets. Extend
the passthrough case to multi-target-capable decoders that only have one
target selected. I.e. the current code was only considering passthrough
*ports* which are only a subset of the potential passthrough decoder
scenarios.

Fixes: e4f6dfa9 ("cxl/region: Fix 'distance' calculation with passthrough ports")
Cc: <stable@vger.kernel.org>
Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/167564540422.847146.13816934143225777888.stgit@dwillia2-xfh.jf.intel.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 4fa4302d
...@@ -993,10 +993,10 @@ static int cxl_port_setup_targets(struct cxl_port *port, ...@@ -993,10 +993,10 @@ static int cxl_port_setup_targets(struct cxl_port *port,
int i, distance; int i, distance;
/* /*
* Passthrough ports impose no distance requirements between * Passthrough decoders impose no distance requirements between
* peers * peers
*/ */
if (port->nr_dports == 1) if (cxl_rr->nr_targets == 1)
distance = 0; distance = 0;
else else
distance = p->nr_targets / cxl_rr->nr_targets; distance = p->nr_targets / cxl_rr->nr_targets;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment