linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Liu <liuj97@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>, Yinghai Lu <yinghai@kernel.org>
Cc: Jiang Liu <jiang.liu@huawei.com>,
	"Rafael J . Wysocki" <rjw@sisk.pl>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Gu Zheng <guz.fnst@cn.fujitsu.com>,
	Toshi Kani <toshi.kani@hp.com>,
	Myron Stowe <myron.stowe@redhat.com>,
	Yijing Wang <wangyijing@huawei.com>, Jiang Liu <liuj97@gmail.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	linux-ia64@vger.kernel.org
Subject: [RFC PATCH v2, part 2 06/18] PCI, IA64: use hotplug-safe iterators to walk PCI buses
Date: Wed, 15 May 2013 00:51:50 +0800	[thread overview]
Message-ID: <1368550322-1045-6-git-send-email-jiang.liu@huawei.com> (raw)
In-Reply-To: <1368550322-1045-1-git-send-email-jiang.liu@huawei.com>

Enhance IA64 architecture specific code to use hotplug-safe iterators
to walk PCI buses.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-ia64@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 arch/ia64/hp/common/sba_iommu.c   | 2 +-
 arch/ia64/sn/kernel/io_common.c   | 2 +-
 arch/ia64/sn/pci/tioca_provider.c | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index bcda5b2..6faf241 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -2156,7 +2156,7 @@ sba_init(void)
 #ifdef CONFIG_PCI
 	{
 		struct pci_bus *b = NULL;
-		while ((b = pci_find_next_bus(b)) != NULL)
+		for_each_pci_root_bus(b)
 			sba_connect_bus(b);
 	}
 #endif
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index 11f2275..87d8d8f 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -530,7 +530,7 @@ sn_io_late_init(void)
 	 * info from the PROM).
 	 */
 	bus = NULL;
-	while ((bus = pci_find_next_bus(bus)) != NULL) {
+	for_each_pci_root_bus(bus) {
 		bussoft = SN_PCIBUS_BUSSOFT(bus);
 		nasid = NASID_GET(bussoft->bs_base);
 		cnode = nasid_to_cnodeid(nasid);
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index a70b11f..cd8c0fb 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -624,7 +624,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
 	    nasid_to_cnodeid(tioca_common->ca_closest_nasid);
 	tioca_common->ca_kernel_private = (u64) tioca_kern;
 
-	bus = pci_find_bus(tioca_common->ca_common.bs_persist_segment,
+	bus = pci_get_bus(tioca_common->ca_common.bs_persist_segment,
 		tioca_common->ca_common.bs_persist_busnum);
 	BUG_ON(!bus);
 	tioca_kern->ca_devices = &bus->devices;
@@ -632,6 +632,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
 	/* init GART */
 
 	if (tioca_gart_init(tioca_kern) < 0) {
+		pci_bus_put(bus);
 		kfree(tioca_kern);
 		kfree(tioca_common);
 		return NULL;
-- 
1.8.1.2


  parent reply	other threads:[~2013-05-14 16:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 16:51 [RFC PATCH v2, part 2 01/18] PCI: introduce hotplug-safe PCI bus iterators Jiang Liu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 02/18] PCI, core: use hotplug-safe iterators to walk PCI buses Jiang Liu
2013-05-14 18:55   ` Yinghai Lu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 03/18] PCI, hotplug: " Jiang Liu
2013-05-14 18:57   ` Yinghai Lu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 04/18] PCI, Alpha: " Jiang Liu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 05/18] PCI, FRV: " Jiang Liu
2013-05-14 16:51 ` Jiang Liu [this message]
2013-05-14 16:51 ` [RFC PATCH v2, part 2 07/18] PCI, Microblaze: " Jiang Liu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 08/18] PCI, mn10300: " Jiang Liu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 09/18] PCI, PPC: " Jiang Liu
2013-05-14 23:30   ` Benjamin Herrenschmidt
2013-05-15 15:07     ` Liu Jiang
2013-05-15 15:17     ` Jiang Liu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 10/18] PCI, SPARC: " Jiang Liu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 11/18] PCI, x86: " Jiang Liu
2013-05-14 18:59   ` Yinghai Lu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 12/18] PCI, ACPI: " Jiang Liu
2013-05-14 20:28   ` Rafael J. Wysocki
2013-05-14 16:51 ` [RFC PATCH v2, part 2 13/18] PCI, DRM: " Jiang Liu
2013-05-14 16:51 ` [RFC PATCH v2, part 2 14/18] PCI, EDAC: use hotplug-safe PCI bus " Jiang Liu
2013-05-22  4:12   ` Gu Zheng
2013-05-25 15:18     ` Liu Jiang
2013-05-14 16:51 ` [RFC PATCH v2, part 2 15/18] PCI, via-camera: use hotplug-safe " Jiang Liu
2013-05-14 16:52 ` [RFC PATCH v2, part 2 16/18] PCI, iommu: " Jiang Liu
2013-05-14 22:13   ` Don Dutile
2013-05-15 15:36     ` Liu Jiang
2013-05-14 16:52 ` [RFC PATCH v2, part 2 17/18] PCI, eeepc-laptop: " Jiang Liu
2013-05-14 16:52 ` [RFC PATCH v2, part 2 18/18] PCI, asus-wmi: " Jiang Liu
2013-05-14 17:05 ` [RFC PATCH v2, part 2 01/18] PCI: introduce hotplug-safe PCI bus iterators Greg Kroah-Hartman
2013-05-15 14:42   ` Liu Jiang
2013-05-15 14:51   ` Liu Jiang
2013-05-14 18:56 ` Yinghai Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368550322-1045-6-git-send-email-jiang.liu@huawei.com \
    --to=liuj97@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=fenghua.yu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=jiang.liu@huawei.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=myron.stowe@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=tony.luck@intel.com \
    --cc=toshi.kani@hp.com \
    --cc=wangyijing@huawei.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).