From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang 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__458.51319232515$1427114998$gmane$org@huawei.com> References: <1427114457-16687-1-git-send-email-wangyijing@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1427114457-16687-1-git-send-email-wangyijing@huawei.com> Sender: linux-m68k-owner@vger.kernel.org List-Id: linux-m68k@vger.kernel.org To: Bjorn Helgaas Cc: Jiang Liu , linux-pci@vger.kernel.org, Yinghai Lu , linux-kernel@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, Russell King , x86@kernel.org, Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , linux-ia64@vger.kernel.org, "David S. Miller" , Guan Xuetao , linux-alpha@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Liviu Dudau , Arnd Bergmann , Geert Uytterhoeven , Yijing Wang , Yijing Wang 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", -- 1.7.1