From patchwork Thu Dec 22 09:07:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhou Wang X-Patchwork-Id: 9484551 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 A422B601D3 for ; Thu, 22 Dec 2016 08:48:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 994DC27B2F for ; Thu, 22 Dec 2016 08:48:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E1ED27DCE; Thu, 22 Dec 2016 08:48:00 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 2653627B2F for ; Thu, 22 Dec 2016 08:48:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754380AbcLVIrn (ORCPT ); Thu, 22 Dec 2016 03:47:43 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:23562 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751564AbcLVIrm (ORCPT ); Thu, 22 Dec 2016 03:47:42 -0500 Received: from 172.24.1.136 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.136]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DSM03108; Thu, 22 Dec 2016 16:41:53 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.235.1; Thu, 22 Dec 2016 16:41:41 +0800 From: Zhou Wang To: "Rafael J. Wysocki" , Len Brown , Tomasz Nowicki , Jayachandran C , Lorenzo Pieralisi , jorn Helgaas CC: , , , , , Zhou Wang Subject: [RFC PATCH] ACPI/PCI: Fix bus range comparation in pci_mcfg_lookup Date: Thu, 22 Dec 2016 17:07:43 +0800 Message-ID: <1482397663-98715-1-git-send-email-wangzhou1@hisilicon.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected 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 Multiple PCIe host bridges may exists in one PCIe segment. So bus range for each host bridge should be in the coverage of bus range of related PCIe segment. This patch will support this kind of scenario: MCFG: bus range: 0x00~0xff. segment: 0. DSDT: host bridge 1: bus range: 0x00~0x1f. segment: 0. host bridge 2: bus range: 0x20~0x4f. segment: 0. Signed-off-by: Zhou Wang Reviewed-by: Tomasz Nowicki Acked-by: Lorenzo Pieralisi --- drivers/acpi/pci_mcfg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c index b5b376e..46a3e32 100644 --- a/drivers/acpi/pci_mcfg.c +++ b/drivers/acpi/pci_mcfg.c @@ -40,11 +40,10 @@ phys_addr_t pci_mcfg_lookup(u16 seg, struct resource *bus_res) struct mcfg_entry *e; /* - * We expect exact match, unless MCFG entry end bus covers more than - * specified by caller. + * We expect the range in bus_res in the coverage of MCFG bus range. */ list_for_each_entry(e, &pci_mcfg_list, list) { - if (e->segment == seg && e->bus_start == bus_res->start && + if (e->segment == seg && e->bus_start <= bus_res->start && e->bus_end >= bus_res->end) return e->addr; }