On Sun, 05 Feb 2023 17:03:24 -0800 Dan Williams <dan.j.williams@xxxxxxxxx> wrote: > 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: e4f6dfa9ef75 ("cxl/region: Fix 'distance' calculation with passthrough ports") > Cc: <stable@xxxxxxxxxxxxxxx> > Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx> > --- > drivers/cxl/core/region.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c > index c82d3b6f3d1f..34cf95217901 100644 > --- a/drivers/cxl/core/region.c > +++ b/drivers/cxl/core/region.c > @@ -1019,10 +1019,10 @@ static int cxl_port_setup_targets(struct cxl_port *port, > int i, distance; > > /* > - * Passthrough ports impose no distance requirements between > + * Passthrough decoders impose no distance requirements between > * peers I think we have a terminology inconsistency. My understanding was we were using passthrough decoders for the special case where there is no programmable hardware. In this case I think we are also considering the case where that hardware must be programmed etc, it's just that we don't care about interleave. I'd just explain what it is rather than trying to assign a term. Decoders that have a single target configured impose... > */ > - if (port->nr_dports == 1) > + if (cxl_rr->nr_targets == 1) > distance = 0; > else > distance = p->nr_targets / cxl_rr->nr_targets; > >