From patchwork Fri Jan 16 01:44:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 5645561 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 3F5029F358 for ; Fri, 16 Jan 2015 04:23:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7BC0920122 for ; Fri, 16 Jan 2015 04:23:16 +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 3317120034 for ; Fri, 16 Jan 2015 04:23:15 +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 1YByOl-0005nG-Kg; Fri, 16 Jan 2015 04:20:39 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YBxwL-0007GB-1N for linux-arm-kernel@bombadil.infradead.org; Fri, 16 Jan 2015 03:51:17 +0000 Received: from [119.145.14.66] (helo=szxga03-in.huawei.com) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YBxwB-0000J3-AQ for linux-arm-kernel@lists.infradead.org; Fri, 16 Jan 2015 03:51:13 +0000 Received: from 172.24.2.119 (EHLO szxeml407-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BAL07444; Fri, 16 Jan 2015 11:47:13 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml407-hub.china.huawei.com (10.82.67.94) with Microsoft SMTP Server id 14.3.158.1; Fri, 16 Jan 2015 11:47:00 +0800 From: Yijing Wang To: Bjorn Helgaas Subject: [PATCH 07/28] PCI: Pass PCI domain number combined with root bus number Date: Fri, 16 Jan 2015 09:44:05 +0800 Message-ID: <1421372666-12288-8-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1421372666-12288-1-git-send-email-wangyijing@huawei.com> References: <1421372666-12288-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.54B889C2.0019, ss=1, re=0.001, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6dfe7ad394c9a6a922d15c8a9343fb87 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150116_035108_757513_445F3228 X-CRM114-Status: GOOD ( 13.40 ) X-Spam-Score: -3.4 (---) Cc: Liviu Dudau , Tony Luck , Russell King , Arnd Bergmann , Marc Zyngier , linux-pci@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , linux-m68k@lists.linux-m68k.org, Geert Uytterhoeven , linux-alpha@vger.kernel.org, Yijing Wang , linux-ia64@vger.kernel.org, Thomas Gleixner , Guan Xuetao , Yinghai Lu , Jiang Liu , linux-arm-kernel@lists.infradead.org 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 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 --- arch/alpha/kernel/pci.c | 5 +++-- arch/alpha/kernel/sys_nautilus.c | 3 ++- 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 | 4 ++-- arch/tile/kernel/pci_gx.c | 5 +++-- arch/x86/pci/acpi.c | 6 +++--- arch/x86/pci/common.c | 3 ++- drivers/pci/xen-pcifront.c | 5 +++-- 15 files changed, 40 insertions(+), 29 deletions(-) diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 97f9730..b15f9f2 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -332,8 +332,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) pci_bus_add_devices(bus); hose->bus = bus; diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c index 2c864bb..f7bfdf3 100644 --- a/arch/alpha/kernel/sys_nautilus.c +++ b/arch/alpha/kernel/sys_nautilus.c @@ -206,7 +206,8 @@ nautilus_init_pci(void) unsigned long memtop = max_low_pfn << PAGE_SHIFT; /* Scan our single hose. */ - bus = pci_scan_bus_legacy(0, alpha_mv.pci_ops, hose); + bus = pci_scan_bus_legacy(PCI_DOMBUS(hose->index, 0), + alpha_mv.pci_ops, hose); hose->bus = bus; pcibios_claim_one_bus(bus); diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 291a582..e457015 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 63b43a6..bcdc5b8 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 009b271..890bd36 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -1339,8 +1339,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..980755a 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 37d512d..927c3dd 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -1602,8 +1602,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 0b32769..612decf 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -750,8 +750,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..7ee0772 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 b36365f..d798b42 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -664,8 +664,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 83d3e30..2603db5 100644 --- a/arch/tile/kernel/pci.c +++ b/arch/tile/kernel/pci.c @@ -306,8 +306,8 @@ 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 d7a0729..1e6ff84 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 cfd1b13..8edea63 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -536,9 +536,9 @@ 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 300d39e..d6879ee 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -470,7 +470,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 240ddbc..a010dfa 100644 --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -477,8 +477,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");