From patchwork Thu Dec 5 15:08:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Betty Dall X-Patchwork-Id: 3288941 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 34B4CC0D4A for ; Thu, 5 Dec 2013 15:17:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EE1620212 for ; Thu, 5 Dec 2013 15:17:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C45A420515 for ; Thu, 5 Dec 2013 15:17:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756622Ab3LEPRt (ORCPT ); Thu, 5 Dec 2013 10:17:49 -0500 Received: from g2t1383g.austin.hp.com ([15.217.136.92]:17135 "EHLO g2t1383g.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752352Ab3LEPRs (ORCPT ); Thu, 5 Dec 2013 10:17:48 -0500 Received: from g5t0007.atlanta.hp.com (g5t0007.atlanta.hp.com [15.192.0.44]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by g2t1383g.austin.hp.com (Postfix) with ESMTPS id 6A5AA1E13; Thu, 5 Dec 2013 15:17:46 +0000 (UTC) Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g5t0007.atlanta.hp.com (Postfix) with ESMTP id C9F6C1400B; Thu, 5 Dec 2013 15:17:37 +0000 (UTC) Received: from linux1.fc.hp.com (swa01lbdc1025-026-vl250-snat1.atlanta.hp.com [16.228.13.91]) by g5t0029.atlanta.hp.com (Postfix) with ESMTP id C232D20001; Thu, 5 Dec 2013 15:17:36 +0000 (UTC) From: Betty Dall To: lenb@kernel.org, rjw@rjwysocki.net, bhelgaas@google.com, robert.moore@intel.com, lv.zheng@intel.com Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, devel@acpica.org, Betty Dall Subject: [PATCH] PCI/ACPI: Use PCIe segment in the ACPI HEST AER error sources Date: Thu, 5 Dec 2013 08:08:24 -0700 Message-Id: <1386256104-20624-1-git-send-email-betty.dall@hp.com> X-Mailer: git-send-email 1.7.7.6 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 In the discussion for this set of patches: https://lkml.org/lkml/2013/6/6/517, Bjorn Helgaas pointed out that the ACPI HEST AER error sources do not have the PCIe segment number associated with the bus. I worked with the ACPI spec and got this change to definition of the "Bus" field into the recently released ACPI Spec 5.0a section 18.3.2.3-5: "Identifies the PCI Bus and Segment of the device. The Bus is encoded in bits 0-7. For systems that expose multiple PCI segment groups, the segment number is encoded in bits 8-23 and bits 24-31 must be zero. For systems that do not expose multiple PCI segment groups, bits 8-31 must be zero. If the GLOBAL flag is specified, this field is ignored." This patch makes use of the new definition in the only place in the kernel that uses the acpi_hest_aer_common's bus field. Signed-off-by: Betty Dall --- drivers/pci/pcie/aer/aerdrv_acpi.c | 8 ++++---- include/acpi/actbl1.h | 11 ++++++++++- 2 files changed, 14 insertions(+), 5 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/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c index cf611ab..93f852b 100644 --- a/drivers/pci/pcie/aer/aerdrv_acpi.c +++ b/drivers/pci/pcie/aer/aerdrv_acpi.c @@ -23,10 +23,10 @@ static inline int hest_match_pci(struct acpi_hest_aer_common *p, struct pci_dev *pci) { - return (0 == pci_domain_nr(pci->bus) && - p->bus == pci->bus->number && - p->device == PCI_SLOT(pci->devfn) && - p->function == PCI_FUNC(pci->devfn)); + return ACPI_HEST_SEGMENT(p->bus) == pci_domain_nr(pci->bus) && + ACPI_HEST_BUS(p->bus) == pci->bus->number && + p->device == PCI_SLOT(pci->devfn) && + p->function == PCI_FUNC(pci->devfn); } static inline bool hest_match_type(struct acpi_hest_header *hest_hdr, diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 556c83ee..0c7428b 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -457,7 +457,7 @@ struct acpi_hest_aer_common { u8 enabled; u32 records_to_preallocate; u32 max_sections_per_record; - u32 bus; + u32 bus; /* bus: bits 0-7; segment: bits 8-23 */ u16 device; u16 function; u16 device_control; @@ -473,6 +473,15 @@ struct acpi_hest_aer_common { #define ACPI_HEST_FIRMWARE_FIRST (1) #define ACPI_HEST_GLOBAL (1<<1) +/* + * The segment/bus of the PCIe device is encoded in the bus field + * of the acpi_hest_aer_common structure as follows: + * 23:8 = segment + * 7:0 = bus + */ +#define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF) +#define ACPI_HEST_BUS(bus) ((bus) & 0xFF) + /* Hardware Error Notification */ struct acpi_hest_notify {