From patchwork Fri Jun 30 10:09:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffy Chen X-Patchwork-Id: 9819075 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 11BDD603F3 for ; Fri, 30 Jun 2017 10:11:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02FBC28554 for ; Fri, 30 Jun 2017 10:11:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC09A285C2; Fri, 30 Jun 2017 10:11:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E003D28554 for ; Fri, 30 Jun 2017 10:11:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752725AbdF3KJG (ORCPT ); Fri, 30 Jun 2017 06:09:06 -0400 Received: from regular1.263xmail.com ([211.150.99.139]:34794 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752074AbdF3KJF (ORCPT ); Fri, 30 Jun 2017 06:09:05 -0400 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.84]) by regular1.263xmail.com (Postfix) with ESMTP id 2FB315646; Fri, 30 Jun 2017 18:08:59 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 1798F39F; Fri, 30 Jun 2017 18:08:58 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: linux-pci@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from localhost (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 1939926VOOY; Fri, 30 Jun 2017 18:09:01 +0800 (CST) From: Jeffy Chen To: linux-pci@vger.kernel.org, mj@ucw.cz Cc: rajatja@google.com, briannorris@chromium.org, Jeffy Chen Subject: [PCIUTILS PATCH v2] lspci: Fix wrong read size for RootSta Date: Fri, 30 Jun 2017 18:09:00 +0800 Message-Id: <1498817340-24918-1-git-send-email-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.1.4 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We are reading wrong size(word) for this cap, since: RootSta has: PCI_EXP_RTSTA_PME_STATUS 0x00010000 /* PME Status */ PCI_EXP_RTSTA_PME_PENDING 0x00020000 /* PME is Pending */ Signed-off-by: Jeffy Chen Reviewed-by: Bjorn Helgaas --- Changes in v2: Sorry, DevCtl2/LnkCtl2 are correct, remove wrong modifies for them... ls-caps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ls-caps.c b/ls-caps.c index 0ca46fb..d4aebc8 100644 --- a/ls-caps.c +++ b/ls-caps.c @@ -879,7 +879,7 @@ static void cap_express_root(struct device *d, int where) printf("\t\tRootCap: CRSVisible%c\n", FLAG(w, PCI_EXP_RTCAP_CRSVIS)); - w = get_conf_word(d, where + PCI_EXP_RTSTA); + w = get_conf_long(d, where + PCI_EXP_RTSTA); printf("\t\tRootSta: PME ReqID %04x, PMEStatus%c PMEPending%c\n", w & PCI_EXP_RTSTA_PME_REQID, FLAG(w, PCI_EXP_RTSTA_PME_STATUS),