linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wangyijing@huawei.com (Yijing Wang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 07/30] PCI: Pass PCI domain number combined with root bus number
Date: Mon, 9 Mar 2015 10:34:04 +0800	[thread overview]
Message-ID: <1425868467-9667-8-git-send-email-wangyijing@huawei.com> (raw)
In-Reply-To: <1425868467-9667-1-git-send-email-wangyijing@huawei.com>

Now we could pass PCI domain combined with bus number
in u32 argu. Because in arm/arm64, PCI domain number
is assigned by pci_bus_assign_domain_nr(). So we leave
pci_scan_root_bus() and pci_create_root_bus() in arm/arm64
unchanged. A new function pci_host_assign_domain_nr()
will be introduced for arm/arm64 to assign domain number
in later patch.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
CC: Matt Turner <mattst88@gmail.com>
CC: Tony Luck <tony.luck@intel.com>
CC: Fenghua Yu <fenghua.yu@intel.com>
CC: Michal Simek <monstr@monstr.eu>
CC: Ralf Baechle <ralf@linux-mips.org>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Sebastian Ott <sebott@linux.vnet.ibm.com>
CC: Gerald Schaefer <gerald.schaefer@de.ibm.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Chris Metcalf <cmetcalf@ezchip.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: linux-alpha at vger.kernel.org
CC: linux-kernel at vger.kernel.org
CC: linux-ia64 at vger.kernel.org
CC: linux-mips at linux-mips.org
CC: linuxppc-dev at lists.ozlabs.org
CC: linux-s390 at vger.kernel.org
CC: linux-sh at vger.kernel.org
CC: sparclinux at vger.kernel.org
CC: xen-devel at lists.xenproject.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/alpha/kernel/pci.c          |    5 +++--
 arch/alpha/kernel/sys_nautilus.c |    4 ++--
 arch/ia64/pci/pci.c              |    4 ++--
 arch/ia64/sn/kernel/io_init.c    |    5 +++--
 arch/microblaze/pci/pci-common.c |    5 +++--
 arch/mips/pci/pci.c              |    4 ++--
 arch/powerpc/kernel/pci-common.c |    5 +++--
 arch/s390/pci/pci.c              |    5 +++--
 arch/sh/drivers/pci/pci.c        |    5 +++--
 arch/sparc/kernel/pci.c          |    5 +++--
 arch/tile/kernel/pci.c           |    5 +++--
 arch/tile/kernel/pci_gx.c        |    5 +++--
 arch/x86/pci/acpi.c              |    7 ++++---
 arch/x86/pci/common.c            |    3 ++-
 drivers/pci/xen-pcifront.c       |    5 +++--
 15 files changed, 42 insertions(+), 30 deletions(-)

diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 5c845ad..deb0a36 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -336,8 +336,9 @@ common_init_pci(void)
 		pci_add_resource_offset(&resources, hose->mem_space,
 					hose->mem_space->start);
 
-		bus = pci_scan_root_bus(NULL, next_busno, alpha_mv.pci_ops,
-					hose, &resources);
+		bus = pci_scan_root_bus(NULL,
+				PCI_DOMBUS(hose->index, next_busno),
+				alpha_mv.pci_ops, hose, &resources);
 		if (!bus)
 			continue;
 		hose->bus = bus;
diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c
index 700686d..be0bbeb 100644
--- a/arch/alpha/kernel/sys_nautilus.c
+++ b/arch/alpha/kernel/sys_nautilus.c
@@ -206,10 +206,10 @@ nautilus_init_pci(void)
 	unsigned long memtop = max_low_pfn << PAGE_SHIFT;
 
 	/* Scan our single hose.  */
-	bus = pci_scan_bus(0, alpha_mv.pci_ops, hose);
+	bus = pci_scan_bus(PCI_DOMBUS(hose->index, 0),
+			alpha_mv.pci_ops, hose);
 	if (!bus)
 		return;
-
 	hose->bus = bus;
 	pcibios_claim_one_bus(bus);
 
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 48cc657..675749f 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -465,8 +465,8 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
 	 * should handle the case here, but it appears that IA64 hasn't
 	 * such quirk. So we just ignore the case now.
 	 */
-	pbus = pci_create_root_bus(NULL, bus, &pci_root_ops, controller,
-				   &info->resources);
+	pbus = pci_create_root_bus(NULL, PCI_DOMBUS(domain, bus),
+			&pci_root_ops, controller, &info->resources);
 	if (!pbus) {
 		pci_free_resource_list(&info->resources);
 		__release_pci_root_info(info);
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index 1be65eb..7e0b7f9 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -266,8 +266,9 @@ sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
 	pci_add_resource_offset(&resources,	&res[1],
 			prom_bussoft_ptr->bs_legacy_mem);
 
-	bus = pci_scan_root_bus(NULL, busnum, &pci_root_ops, controller,
-				&resources);
+	bus = pci_scan_root_bus(NULL,
+			PCI_DOMBUS(controller->segment, busnum),
+			&pci_root_ops, controller, &resources);
  	if (bus == NULL) {
 		kfree(res);
 		kfree(controller);
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index 6d8d173..34a32ec 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -1350,8 +1350,9 @@ static void pcibios_scan_phb(struct pci_controller *hose)
 
 	pcibios_setup_phb_resources(hose, &resources);
 
-	bus = pci_scan_root_bus(hose->parent, hose->first_busno,
-				hose->ops, hose, &resources);
+	bus = pci_scan_root_bus(hose->parent,
+			PCI_DOMBUS(hose->global_number, hose->first_busno),
+			hose->ops, hose, &resources);
 	if (bus == NULL) {
 		pr_err("Failed to create bus for PCI domain %04x\n",
 		       hose->global_number);
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 9eb54b5..86f8d2b 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -92,8 +92,8 @@ static void pcibios_scanbus(struct pci_controller *hose)
 	pci_add_resource_offset(&resources,
 				hose->mem_resource, hose->mem_offset);
 	pci_add_resource_offset(&resources, hose->io_resource, hose->io_offset);
-	bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
-				&resources);
+	bus = pci_scan_root_bus(NULL, PCI_DOMBUS(hose->index, next_busno),
+			hose->pci_ops, hose, &resources);
 	if (!bus)
 		pci_free_resource_list(&resources);
 
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 2a525c9..a467aca 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1612,8 +1612,9 @@ void pcibios_scan_phb(struct pci_controller *hose)
 	pci_add_resource(&resources, &hose->busn);
 
 	/* Create an empty bus for the toplevel */
-	bus = pci_create_root_bus(hose->parent, hose->first_busno,
-				  hose->ops, hose, &resources);
+	bus = pci_create_root_bus(hose->parent,
+			PCI_DOMBUS(hose->global_number, hose->first_busno),
+			hose->ops, hose, &resources);
 	if (bus == NULL) {
 		pr_err("Failed to create bus for PCI domain %04x\n",
 			hose->global_number);
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index a2a7391..20e662f 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -770,8 +770,9 @@ static int zpci_scan_bus(struct zpci_dev *zdev)
 	if (ret)
 		return ret;
 
-	zdev->bus = pci_scan_root_bus(NULL, ZPCI_BUS_NR, &pci_root_ops,
-				      zdev, &resources);
+	zdev->bus = pci_scan_root_bus(NULL,
+			PCI_DOMBUS(zdev->domain, ZPCI_BUS_NR), &pci_root_ops,
+			zdev, &resources);
 	if (!zdev->bus) {
 		zpci_cleanup_bus_resources(zdev);
 		return -EIO;
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index efc1051..116f80f 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -52,8 +52,9 @@ static void pcibios_scanbus(struct pci_channel *hose)
 		pci_add_resource_offset(&resources, res, offset);
 	}
 
-	bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
-				&resources);
+	bus = pci_scan_root_bus(NULL,
+			PCI_DOMBUS(hose->index, next_busno),
+			hose->pci_ops, hose, &resources);
 	hose->bus = bus;
 
 	need_domain_info = need_domain_info || hose->index;
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 9ce5afe..838fe1e 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -667,8 +667,9 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
 	pbm->busn.end	= pbm->pci_last_busno;
 	pbm->busn.flags	= IORESOURCE_BUS;
 	pci_add_resource(&resources, &pbm->busn);
-	bus = pci_create_root_bus(parent, pbm->pci_first_busno, pbm->pci_ops,
-				  pbm, &resources);
+	bus = pci_create_root_bus(parent,
+			PCI_DOMBUS(pbm->index, pbm->pci_first_busno),
+			pbm->pci_ops, pbm, &resources);
 	if (!bus) {
 		printk(KERN_ERR "Failed to create bus for %s\n",
 		       node->full_name);
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index 9475a74..25b0d9b 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -306,8 +306,9 @@ int __init pcibios_init(void)
 
 			pci_add_resource(&resources, &ioport_resource);
 			pci_add_resource(&resources, &iomem_resource);
-			bus = pci_scan_root_bus(NULL, 0, controller->ops,
-						controller, &resources);
+			bus = pci_scan_root_bus(NULL,
+				PCI_DOMBUS(controller->index, 0),
+				controller->ops, controller, &resources);
 			controller->root_bus = bus;
 			controller->last_busno = bus->busn_res.end;
 		}
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c
index b1df847..f6f41f3 100644
--- a/arch/tile/kernel/pci_gx.c
+++ b/arch/tile/kernel/pci_gx.c
@@ -881,8 +881,9 @@ int __init pcibios_init(void)
 					controller->mem_offset);
 		pci_add_resource(&resources, &controller->io_space);
 		controller->first_busno = next_busno;
-		bus = pci_scan_root_bus(NULL, next_busno, controller->ops,
-					controller, &resources);
+		bus = pci_scan_root_bus(NULL,
+				PCI_DOMBUS(controller->index, next_busno),
+				controller->ops, controller, &resources);
 		controller->root_bus = bus;
 		next_busno = bus->busn_res.end + 1;
 	}
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 6ac2738..ad0e926 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -424,9 +424,10 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
 		}
 
 		if (!setup_mcfg_map(info, domain, (u8)root->secondary.start,
-				    (u8)root->secondary.end, root->mcfg_addr))
-			bus = pci_create_root_bus(NULL, busnum, &pci_root_ops,
-						  sd, &resources);
+				(u8)root->secondary.end, root->mcfg_addr))
+			bus = pci_create_root_bus(NULL,
+				PCI_DOMBUS(domain, busnum), &pci_root_ops,
+				sd, &resources);
 
 		if (bus) {
 			pci_scan_child_bus(bus);
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 0cbc723..0160280 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -486,7 +486,8 @@ void pcibios_scan_root(int busnum)
 	sd->node = x86_pci_root_bus_node(busnum);
 	x86_pci_root_bus_resources(busnum, &resources);
 	printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum);
-	bus = pci_scan_root_bus(NULL, busnum, &pci_root_ops, sd, &resources);
+	bus = pci_scan_root_bus(NULL, PCI_DOMBUS(0, busnum),
+			&pci_root_ops, sd, &resources);
 	if (!bus) {
 		pci_free_resource_list(&resources);
 		kfree(sd);
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 9e7c28b..af6144a 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -479,8 +479,9 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
 
 	pci_lock_rescan_remove();
 
-	b = pci_scan_root_bus(&pdev->xdev->dev, bus,
-				  &pcifront_bus_ops, sd, &resources);
+	b = pci_scan_root_bus(&pdev->xdev->dev,
+			PCI_DOMBUS(sd->domain, bus),
+			&pcifront_bus_ops, sd, &resources);
 	if (!b) {
 		dev_err(&pdev->xdev->dev,
 			"Error creating PCI Frontend Bus!\n");
-- 
1.7.1

  parent reply	other threads:[~2015-03-09  2:34 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09  2:33 [PATCH v6 00/30] Refine PCI scan interfaces and make generic pci host bridge Yijing Wang
2015-03-09  2:33 ` [PATCH v6 01/30] PCI: Rip out pci_bus_add_devices() from pci_scan_bus() Yijing Wang
2015-03-09  2:33 ` [PATCH v6 02/30] PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus() Yijing Wang
2015-03-09  2:34 ` [PATCH v6 03/30] PCI: Export busn_resource to drivers/pci Yijing Wang
2015-03-11 22:28   ` Bjorn Helgaas
2015-03-12 11:42     ` Yijing Wang
2015-03-12 19:32       ` Bjorn Helgaas
2015-03-13  1:57         ` Yijing Wang
2015-03-09  2:34 ` [PATCH v6 04/30] xen/PCI: Don't use deprecated function pci_scan_bus_parented() Yijing Wang
2015-03-11 22:32   ` Bjorn Helgaas
2015-03-12 11:46     ` Yijing Wang
2015-03-12 19:35       ` Bjorn Helgaas
2015-03-13  2:36         ` Yijing Wang
2015-03-13 13:24           ` Bjorn Helgaas
2015-03-13 14:01             ` Konrad Rzeszutek Wilk
2015-03-13 14:26               ` Bjorn Helgaas
2015-03-25 19:23                 ` Konrad Rzeszutek Wilk
2015-03-26  1:18                   ` Yijing Wang
2015-03-26  7:30                   ` Yijing Wang
2015-03-09  2:34 ` [PATCH v6 05/30] PCI: Remove deprecated pci_scan_bus_parented() Yijing Wang
2015-03-09  2:34 ` [PATCH v6 06/30] PCI: Combine PCI domain and bus number in u32 arg Yijing Wang
2015-03-12  1:29   ` Bjorn Helgaas
2015-03-12 12:14     ` Yijing Wang
2015-03-12 19:49       ` Bjorn Helgaas
2015-03-13  3:19         ` Yijing Wang
2015-03-09  2:34 ` Yijing Wang [this message]
2015-03-12  1:34   ` [PATCH v6 07/30] PCI: Pass PCI domain number combined with root bus number Bjorn Helgaas
2015-03-12 12:20     ` Yijing Wang
2015-03-17  5:15   ` [Xen-devel] " Manish Jaggi
2015-03-17 14:05     ` Ian Campbell
2015-03-09  2:34 ` [PATCH v6 08/30] PCI: Introduce pci_host_assign_domain_nr() to assign domain Yijing Wang
2015-03-12  1:39   ` Bjorn Helgaas
2015-03-12 12:23     ` Yijing Wang
2015-03-09  2:34 ` [PATCH v6 09/30] PCI: Separate pci_host_bridge creation out of pci_create_root_bus() Yijing Wang
2015-03-12  3:52   ` Bjorn Helgaas
2015-03-12 13:44     ` Yijing Wang
2015-03-21 23:21   ` Suravee Suthikulpanit
2015-03-23  1:08     ` Yijing Wang
2015-03-09  2:34 ` [PATCH v6 10/30] PCI: Introduce pci_host_bridge_list to manage host bridges Yijing Wang
2015-03-12  2:55   ` Bjorn Helgaas
2015-03-12 13:03     ` Yijing Wang
2015-03-12 19:56       ` Bjorn Helgaas
2015-03-13  3:28         ` Yijing Wang
2015-03-13 14:33           ` Bjorn Helgaas
2015-03-16  1:28             ` Yijing Wang
2015-03-09  2:34 ` [PATCH v6 11/30] PCI: Save sysdata in pci_host_bridge drvdata Yijing Wang
2015-03-09  2:34 ` [PATCH v6 12/30] PCI: Introduce pci_host_bridge_ops to support host specific operations Yijing Wang
2015-03-12  3:23   ` Bjorn Helgaas
2015-03-12 13:14     ` Yijing Wang
2015-03-09  2:34 ` [PATCH v6 13/30] PCI: Introduce new scan function pci_scan_host_bridge() Yijing Wang
2015-03-12  3:25   ` Bjorn Helgaas
2015-03-12 13:15     ` Yijing Wang
2015-03-09  2:34 ` [PATCH v6 14/30] x86/PCI: Refine pci_acpi_scan_root() with generic pci_host_bridge Yijing Wang
2015-03-09  2:34 ` [PATCH v6 15/30] ia64/PCI: " Yijing Wang
2015-03-09  2:34 ` [PATCH v6 16/30] powerpc/pci: Rename pcibios_root_bridge_prepare() Yijing Wang
2015-03-09  2:34 ` [PATCH v6 17/30] powerpc/pci: Use pci_scan_host_bridge() for simplicity Yijing Wang
2015-03-09  2:34 ` [PATCH v6 18/30] PCI: Remove weak pcibios_root_bridge_prepare() Yijing Wang
2015-03-09  2:34 ` [PATCH v6 19/30] sparc/PCI: Claim bus resources before pci_bus_add_devices() Yijing Wang
2015-03-09  2:34 ` [PATCH v6 20/30] sparc/PCI: Use pci_scan_host_bridge() for simplicity Yijing Wang
2015-03-12  3:30   ` Bjorn Helgaas
2015-03-12 13:17     ` Yijing Wang
2015-03-09  2:34 ` [PATCH v6 21/30] PCI: Introduce pci_bus_child_max_busnr() Yijing Wang
2015-03-12  3:33   ` Bjorn Helgaas
2015-03-12 13:24     ` Yijing Wang
2015-03-12  3:36   ` Bjorn Helgaas
2015-03-12 13:28     ` Yijing Wang
2015-03-12 20:00       ` Bjorn Helgaas
2015-03-09  2:34 ` [PATCH v6 22/30] parisc/PCI: Use pci_scan_root_bus() for simplicity Yijing Wang
2015-03-09  2:34 ` [PATCH v6 23/30] PCI/mvebu: Use pci_common_init_dev() to simplify code Yijing Wang
2015-03-09  2:34 ` [PATCH v6 24/30] PCI/tegra: Remove redundant tegra_pcie_scan_bus() Yijing Wang
2015-03-09  2:34 ` [PATCH v6 25/30] PCI/designware: Use pci_scan_root_bus() for simplicity Yijing Wang
2015-03-09  2:34 ` [PATCH v6 26/30] PCI/xgene: Use pci_scan_root_bus() instead of pci_create_root_bus() Yijing Wang
2015-03-09  2:34 ` [PATCH v6 27/30] PCI: Rename __pci_create_root_bus() to pci_create_root_bus() Yijing Wang
2015-03-09  2:34 ` [PATCH v6 28/30] PCI: Export find_pci_host_bridge() and rename to pci_find_host_bridge() Yijing Wang
2015-03-12  3:43   ` Bjorn Helgaas
2015-03-12 13:29     ` Yijing Wang
2015-03-09  2:34 ` [PATCH v6 29/30] PCI: Remove platform specific pci_domain_nr() Yijing Wang
2015-03-09  2:34 ` [PATCH v6 30/30] PCI: Remove pci_bus_assign_domain_nr() Yijing Wang
2015-03-12  3:48   ` Bjorn Helgaas
2015-03-12 13:32     ` Yijing Wang
2015-03-12 21:23 ` [PATCH v6 00/30] Refine PCI scan interfaces and make generic pci host bridge Bjorn Helgaas
2015-03-13  3:29   ` Yijing Wang
2015-03-13 11:31   ` Liviu Dudau
2015-03-13 14:48     ` Bjorn Helgaas
2015-03-16  1:31       ` Yijing Wang
2015-03-16  1:48     ` Yijing Wang
2015-03-17 10:55       ` Liviu Dudau

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=1425868467-9667-8-git-send-email-wangyijing@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.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).