@@ -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),
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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html