On Thu, Mar 18, 2021 at 12:02:44PM -0500, Bjorn Helgaas wrote: > Drop the "downgraded" reporting for Downstream Ports. If there is a device > below, we'll still complain at that end if it supports a faster/wider link > than is available. This makes sense, but I think we should still report if training has gone horribly wrong. Maybe something like this ... > +++ b/ls-caps.c > @@ -758,13 +758,16 @@ static char *link_speed(int speed) > } > } > > -static char *link_compare(int sta, int cap) > +static char *link_compare(int type, int sta, int cap) > { > + if ((type == PCI_EXP_TYPE_ROOT_PORT) || (type == PCI_EXP_TYPE_DOWNSTREAM) || > + (type == PCI_EXP_TYPE_PCIE_BRIDGE)) > + return ""; > if (sta < cap) > - return "downgraded"; > + return " (downgraded)"; > if (sta > cap) > - return "strange"; > - return "ok"; > + return " (strange)"; > + return " (ok)"; > } { if (sta > cap) return " (overdriven)"; if (sta == cap) return ""; if ((type == PCI_EXP_TYPE_ROOT_PORT) || ((type == PCI_EXP_TYPE_DOWNSTREAM) || ((type == PCI_EXP_TYPE_PCIE_BRIDGE)) return ""; return " (downgraded)"; } (i don't know if the PCIe spec has a better word than overdriven for this situation, but i don't like "strange". "invalid", maybe?) The reason i say we should report it on the downstream port is that we probably can't get to the config data on the upstream port/device, so this may be our best chance to find out what's wrong.