From patchwork Tue Sep 25 08:26:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 186736 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id C14272C0156 for ; Tue, 25 Sep 2012 18:27:34 +1000 (EST) Received: from acsinet14.oracle.com (acsinet14.oracle.com [141.146.126.236]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "acsinet14.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5F8482C0085 for ; Tue, 25 Sep 2012 18:27:05 +1000 (EST) Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet14.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q8P8Qwx5030629 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 Sep 2012 08:26:59 GMT Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q8P8Qpj1020325 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Sep 2012 08:26:52 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q8P8QoVc014868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Sep 2012 08:26:50 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q8P8QnmN007904; Tue, 25 Sep 2012 03:26:49 -0500 Received: from linux-siqj.site (/75.36.245.102) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 25 Sep 2012 01:26:49 -0700 From: Yinghai Lu To: Bjorn Helgaas , Len Brown Subject: [PATCH 27/29] PCI, powerpc: kill pci_root_buses in resources reservations Date: Tue, 25 Sep 2012 01:26:28 -0700 Message-Id: <1348561590-28067-28-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1348561590-28067-1-git-send-email-yinghai@kernel.org> References: <1348561590-28067-1-git-send-email-yinghai@kernel.org> X-Source-IP: acsinet15.oracle.com [141.146.126.227] Cc: linux-pci@vger.kernel.org, Yinghai Lu , linuxppc-dev@lists.ozlabs.org, Paul Mackerras X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Signed-off-by: Yinghai Lu Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/pci-common.c | 13 ++++++------- arch/powerpc/kernel/pci_64.c | 7 ++++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 43fea54..1e13133 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -1390,11 +1390,11 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus) void __init pcibios_resource_survey(void) { - struct pci_bus *b; + struct pci_host_bridge *host_bridge = NULL; /* Allocate and assign resources */ - list_for_each_entry(b, &pci_root_buses, node) - pcibios_allocate_bus_resources(b); + for_each_pci_host_bridge(host_bridge) + pcibios_allocate_bus_resources(host_bridge->bus); pcibios_allocate_resources(0); pcibios_allocate_resources(1); @@ -1402,10 +1402,9 @@ void __init pcibios_resource_survey(void) * the low IO area and the VGA memory area if they intersect the * bus available resources to avoid allocating things on top of them */ - if (!pci_has_flag(PCI_PROBE_ONLY)) { - list_for_each_entry(b, &pci_root_buses, node) - pcibios_reserve_legacy_regions(b); - } + if (!pci_has_flag(PCI_PROBE_ONLY)) + for_each_pci_host_bridge(host_bridge) + pcibios_reserve_legacy_regions(host_bridge); /* Now, if the platform didn't decide to blindly trust the firmware, * we proceed to assigning things that were left unassigned diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 4ff190f..dafa7c5 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c @@ -213,8 +213,9 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, { struct pci_controller* hose; struct list_head *ln; - struct pci_bus *bus = NULL; + struct pci_bus *bus; struct device_node *hose_node; + struct pci_host_bridge *host_bridge = NULL; /* Argh ! Please forgive me for that hack, but that's the * simplest way to get existing XFree to not lockup on some @@ -234,8 +235,8 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, * used on pre-domains setup. We return the first match */ - for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) { - bus = pci_bus_b(ln); + for_each_pci_host_bridge(host_bridge) { + bus = host_bridge->bus; if (in_bus >= bus->number && in_bus <= bus->busn_res.end) break; bus = NULL;