From patchwork Mon Sep 9 23:14:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2863431 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7CA4F9F485 for ; Mon, 9 Sep 2013 23:14:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B594320260 for ; Mon, 9 Sep 2013 23:14:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E13122011E for ; Mon, 9 Sep 2013 23:14:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755880Ab3IIXOc (ORCPT ); Mon, 9 Sep 2013 19:14:32 -0400 Received: from mail-ye0-f177.google.com ([209.85.213.177]:34185 "EHLO mail-ye0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755756Ab3IIXOb (ORCPT ); Mon, 9 Sep 2013 19:14:31 -0400 Received: by mail-ye0-f177.google.com with SMTP id q9so1713609yen.8 for ; Mon, 09 Sep 2013 16:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=BCOAPA7O7ae3G/KlblM9I4+plMcy0f6ekCSQHSXbraE=; b=JOKk5SuKcr2GGKX5AakjGdWK3ZlqHgQWdZ2K8XEXijTgiowiqVP9UP7j+w/15l86LD YRorD2jvJ6Q3711gAI4YRzWaPWEAw8l1hmtM0Ra8nFjDvWo5OTdvc4uL15OWATCcKkvS Sdf9jvfI+G+BgJA4x6Ye9HT8AmDIgI8Gutvu7urbKJDKSUb41mqyduI9socvkdGOxh9l PHG+SwtUIkbZ9+Zy9HceekBWsUv9r+GhnPGtaK+uiUdkg/tUZrQe+sDUluigcGeguzlc lYnUdTJgjPy9ReC1pyQ9YNjfmAnVAWSbouTxbWna8+UzWiZ0prOX5EeSBhxjvKts7xrb 1XWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=BCOAPA7O7ae3G/KlblM9I4+plMcy0f6ekCSQHSXbraE=; b=EH6O0J9YMX+E5kJdYYlxDmOvKRZqvjFct8Ldz4DZfId8iWSZxTw8oZX6BtsoheIHcv xCAmJ/9k9LkxnezP8BNz9oPYj91+tgcepAhNmh50ajhZO2sFSLiwG2Gxh0z+LVmgI87a pie/WqIUQ/ma1M/bcXUZkAzQMtz6XkBhg9PcHsZicPwm+6q0S5djgJYOhIsltXuGers+ kgHqNC4/f16DSOI3E8jEocbpZjrj1zFEsg+N60fdiOPMIWxn0UTUyUwytfAH/RsyJn5U nB020xAjikIXSTIeHEbwbz2viiHMSk4+ee+B8IrRF8mHJG3W+CQfOvIlzIBW3D0d19s8 BkvQ== X-Gm-Message-State: ALoCoQm1Zyp9oM9cXTQiNCM7DCk+w/Nuct0WOdOGBXkToFE3xMVzpAzfP0L4XlGUYJy1TuiLHTat1l8y3uhVEhaT5k2Drxkn16ATkGt15stirLTquIE1WetqQ4DGLSi9fw7nTydLeD0HMJEGx6DualSF8eUQG+YF2IZsOL8o387ATEppRNfSxjlSNhXVrmB8RobLQlim8wPyM52h6lX+2ePChmX5TUiswA== X-Received: by 10.236.124.172 with SMTP id x32mr3275241yhh.59.1378768471310; Mon, 09 Sep 2013 16:14:31 -0700 (PDT) Received: from localhost ([172.16.51.73]) by mx.google.com with ESMTPSA id z48sm20698106yha.19.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Sep 2013 16:14:30 -0700 (PDT) Subject: [PATCH 7/7] lspci: Decode PCIe LnkSta "Link Training" only for relevant functions To: Martin Mares From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Date: Mon, 09 Sep 2013 17:14:28 -0600 Message-ID: <20130909231428.30095.22433.stgit@bhelgaas-glaptop> In-Reply-To: <20130909231345.30095.61638.stgit@bhelgaas-glaptop> References: <20130909231345.30095.61638.stgit@bhelgaas-glaptop> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 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),