From: Bjorn Helgaas <bhelgaas@google.com>
To: Martin Mares <mj@ucw.cz>
Cc: linux-pci@vger.kernel.org
Subject: [PATCH 7/7] lspci: Decode PCIe LnkSta "Link Training" only for relevant functions
Date: Mon, 09 Sep 2013 17:14:28 -0600 [thread overview]
Message-ID: <20130909231428.30095.22433.stgit@bhelgaas-glaptop> (raw)
In-Reply-To: <20130909231345.30095.61638.stgit@bhelgaas-glaptop>
The PCIe Link Status "Link Training" bit is only valid for functions
at the upstream end of a link, i.e., Root Ports, Downstream Ports, and
PCI-to-PCIe Bridges.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
ls-caps.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ls-caps.c b/ls-caps.c
index f192510..87b1a0d 100644
--- a/ls-caps.c
+++ b/ls-caps.c
@@ -786,11 +786,15 @@ static void cap_express_link(struct device *d, int where, int type)
FLAG(w, PCI_EXP_LNKCTL_AUTBWIE));
w = get_conf_word(d, where + PCI_EXP_LNKSTA);
- printf("\t\tLnkSta:\tSpeed %s, Width x%d, TrErr%c Train%c SlotClk%c DLActive%c BWMgmt%c ABWMgmt%c\n",
+ printf("\t\tLnkSta:\tSpeed %s, Width x%d, TrErr%c",
link_speed(w & PCI_EXP_LNKSTA_SPEED),
(w & PCI_EXP_LNKSTA_WIDTH) >> 4,
- FLAG(w, PCI_EXP_LNKSTA_TR_ERR),
- FLAG(w, PCI_EXP_LNKSTA_TRAIN),
+ FLAG(w, PCI_EXP_LNKSTA_TR_ERR));
+ if ((type == PCI_EXP_TYPE_ROOT_PORT) || (type == PCI_EXP_TYPE_DOWNSTREAM) ||
+ (type == PCI_EXP_TYPE_PCIE_BRIDGE))
+ printf(" Train%c",
+ FLAG(w, PCI_EXP_LNKSTA_TRAIN));
+ printf(" SlotClk%c DLActive%c BWMgmt%c ABWMgmt%c\n",
FLAG(w, PCI_EXP_LNKSTA_SL_CLK),
FLAG(w, PCI_EXP_LNKSTA_DL_ACT),
FLAG(w, PCI_EXP_LNKSTA_BWMGMT),
next prev parent reply other threads:[~2013-09-09 23:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-09 23:13 [PATCH 1/7] lspci: Label PCIe LnkCap "L0s Exit Latency" as "L0s", not "L0" Bjorn Helgaas
2013-09-09 23:13 ` [PATCH 2/7] lspci: Decode PCIe DevCap "Acceptable Latencies" only for Endpoints Bjorn Helgaas
2013-09-09 23:14 ` [PATCH 3/7] lspci: Decode PCIe DevCap/DevCtl FLReset " Bjorn Helgaas
2013-09-09 23:14 ` [PATCH 4/7] lspci: Clarify "PCIe-to-PCI/PCI-X" desc and Bridge Retry Config Enable Bjorn Helgaas
2013-09-09 23:14 ` [PATCH 5/7] lspci: Decode PCIe LnkCtl "Read Completion Boundary" for PCIe-to-PCI bridges Bjorn Helgaas
2013-09-09 23:14 ` [PATCH 6/7] lspci: Drop PCIe LnkCtl "Retrain Link" decoding Bjorn Helgaas
2013-09-09 23:14 ` Bjorn Helgaas [this message]
2013-11-10 11:33 ` [PATCH 1/7] lspci: Label PCIe LnkCap "L0s Exit Latency" as "L0s", not "L0" Martin Mares
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=20130909231428.30095.22433.stgit@bhelgaas-glaptop \
--to=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=mj@ucw.cz \
/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;
as well as URLs for NNTP newsgroup(s).