From patchwork Mon Mar 23 12:40:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 6073241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8B27E9F2A9 for ; Mon, 23 Mar 2015 13:09:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC8D22024F for ; Mon, 23 Mar 2015 13:09:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D2DF72024C for ; Mon, 23 Mar 2015 13:09:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ya22m-0002g8-2x; Mon, 23 Mar 2015 13:05:24 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ya1rL-0007zQ-L8 for linux-arm-kernel@lists.infradead.org; Mon, 23 Mar 2015 12:53:37 +0000 Received: from 172.24.2.119 (EHLO szxeml434-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CIW12380; Mon, 23 Mar 2015 20:44:02 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.158.1; Mon, 23 Mar 2015 20:43:47 +0800 From: Yijing Wang To: Bjorn Helgaas Subject: [PATCH v7 08/31] PCI: Update pci_host_bridge bus resource Date: Mon, 23 Mar 2015 20:40:34 +0800 Message-ID: <1427114457-16687-9-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1427114457-16687-1-git-send-email-wangyijing@huawei.com> References: <1427114457-16687-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150323_055336_367797_5BAF6B1E X-CRM114-Status: GOOD ( 11.31 ) X-Spam-Score: -2.3 (--) Cc: linux-ia64@vger.kernel.org, linux-pci@vger.kernel.org, Yijing Wang , Guan Xuetao , Russell King , x86@kernel.org, Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, Benjamin Herrenschmidt , Arnd Bergmann , Marc Zyngier , Rusty Russell , linux-m68k@lists.linux-m68k.org, Thomas Gleixner , Yinghai Lu , Yijing Wang , Liviu Dudau , Tony Luck , linux-kernel@vger.kernel.org, Jiang Liu , linux-alpha@vger.kernel.org, "David S. Miller" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 From: Yijing Wang Sometimes, the bus resource start number is not equal to root bus number. For example, in pci_scan_bus(), we always add the default bus resource which start bus number is 0, but the root bus number callers given may != 0, so we need to update pci_host_bridge bus resource, because we would check whether host bridge bus resoruce is confict in later patch. Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c index ecc1a7c..1a9834b 100644 --- a/drivers/pci/host-bridge.c +++ b/drivers/pci/host-bridge.c @@ -26,8 +26,11 @@ static void pci_host_update_busn_res( struct resource_entry *window; resource_list_for_each_entry(window, resources) - if (window->res->flags & IORESOURCE_BUS) + if (window->res->flags & IORESOURCE_BUS) { + if (bus > window->res->start) + window->res->start = bus; return; + } pr_info( "No busn resource found for pci%04x:%02x, will use [bus %02x-ff]\n",