From: Matthew Wilcox <willy@infradead.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Martin Mares" <mj@ucw.cz>, "Pali Rohár" <pali@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
linux-pci@vger.kernel.org, "Bjorn Helgaas" <bhelgaas@google.com>
Subject: Re: [PATCH] lspci: Don't report PCIe link downgrades for downstream ports
Date: Thu, 18 Mar 2021 17:33:25 +0000 [thread overview]
Message-ID: <20210318173325.GR3420@casper.infradead.org> (raw)
In-Reply-To: <20210318170244.151240-1-helgaas@kernel.org>
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.
next prev parent reply other threads:[~2021-03-18 17:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 17:02 [PATCH] lspci: Don't report PCIe link downgrades for downstream ports Bjorn Helgaas
2021-03-18 17:11 ` Bjorn Helgaas
2021-03-18 17:33 ` Matthew Wilcox [this message]
2022-01-21 13:20 ` Martin Mareš
2021-03-21 16:09 ` Pali Rohár
2021-03-21 16:32 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210318173325.GR3420@casper.infradead.org \
--to=willy@infradead.org \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=kw@linux.com \
--cc=linux-pci@vger.kernel.org \
--cc=mj@ucw.cz \
--cc=pali@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox