From patchwork Wed Nov 19 07:32:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 41102 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5BF8E20CBB for ; Wed, 19 Nov 2014 06:56:27 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id s18sf5295819lam.10 for ; Tue, 18 Nov 2014 22:56:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=FZkjq5DNzP9DLBDv9ozMpKA//vXvLrmjZfBehD1OMzQ=; b=U7DHcBmopya11TkrMC+qxAtNDyTcASXdQwk0kh1XzWxJ8ReQfUK9xX4Do34KqZlLDR T/y2WlLCjdHcCz892dtKFnfe1cfzjBKGY27E3IQtWlMw8EScxjRjEFk4dj+Qw1Tcp1jz bvchksDT1yAm+Hw7c3OEzKAyOlGUMWqWyehPOQPPDkvwuli0n6KnKv73OnblxMfXLEyf wj0g7F2WSMM9D4FFDpj8sH+BAU1XgR69u9Mx8vURvKV3tN8WXwuwQyOVcdH8q+Snt1iX QHOCARDUGw1vKc0Ka0dFp8GowZ8MSA1PJqCtm7oloFXQ5pdge+GKI6V3p47bhvv4onaa SQdA== X-Gm-Message-State: ALoCoQkYWdf5g+0uLW3hz8Hg0/Qdqyw+8G25n1LL2Q0TNMjQ3if4j/wFwGh3d3JiJBnPdgVbjqVj X-Received: by 10.181.12.37 with SMTP id en5mr6512665wid.6.1416380186213; Tue, 18 Nov 2014 22:56:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.1 with SMTP id a1ls1111493lae.19.gmail; Tue, 18 Nov 2014 22:56:26 -0800 (PST) X-Received: by 10.152.234.163 with SMTP id uf3mr3673577lac.45.1416380186055; Tue, 18 Nov 2014 22:56:26 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id g8si820868laa.47.2014.11.18.22.56.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Nov 2014 22:56:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id hz20so1423620lab.20 for ; Tue, 18 Nov 2014 22:56:25 -0800 (PST) X-Received: by 10.112.162.41 with SMTP id xx9mr40286732lbb.21.1416380185927; Tue, 18 Nov 2014 22:56:25 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp37326lbc; Tue, 18 Nov 2014 22:56:24 -0800 (PST) X-Received: by 10.68.196.163 with SMTP id in3mr43075144pbc.100.1416380184019; Tue, 18 Nov 2014 22:56:24 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id hx9si1183859pad.168.2014.11.18.22.56.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Nov 2014 22:56:24 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1XqzAA-00051x-7v; Wed, 19 Nov 2014 06:54:50 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XqzA2-0004ZJ-AY for linux-arm-kernel@lists.infradead.org; Wed, 19 Nov 2014 06:54:44 +0000 Received: from 172.24.2.119 (EHLO szxeml450-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CCO65275; Wed, 19 Nov 2014 14:51:58 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml450-hub.china.huawei.com (10.82.67.193) with Microsoft SMTP Server id 14.3.158.1; Wed, 19 Nov 2014 14:51:43 +0800 From: Yijing Wang To: Bjorn Helgaas Subject: [PATCH 5/5] PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus() Date: Wed, 19 Nov 2014 15:32:49 +0800 Message-ID: <1416382369-13587-6-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1416382369-13587-1-git-send-email-wangyijing@huawei.com> References: <1416382369-13587-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141118_225442_901487_02EB99C8 X-CRM114-Status: GOOD ( 13.99 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [119.145.14.65 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record Cc: Liviu Dudau , Tony Luck , Russell King , Arnd Bergmann , linux-mips@linux-mips.org, linux-sh@vger.kernel.org, linux-pci@vger.kernel.org, linux-xtensa@linux-xtensa.org, x86@kernel.org, sparclinux@vger.kernel.org, Geert Uytterhoeven , linux-alpha@vger.kernel.org, Yijing Wang , linux-ia64@vger.kernel.org, Thomas Gleixner , 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: wangyijing@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Just like pci_scan_bus(), we also should rip out pci_bus_add_devices() from pci_scan_root_bus(). Lots platforms first call pci_scan_root_bus(), but after that, they call pci_bus_size_bridges() and pci_bus_assign_resources(). Place pci_bus_add_devices() in pci_scan_root_bus() hurts PCI scan logic. Should no functional change. Signed-off-by: Yijing Wang CC: linux-alpha@vger.kernel.org CC: linux-ia64@vger.kernel.org CC: linux-mips@linux-mips.org CC: linux-xtensa@linux-xtensa.org CC: linux-arm-kernel@lists.infradead.org CC: linux-sh@vger.kernel.org CC: sparclinux@vger.kernel.org --- arch/alpha/kernel/pci.c | 2 ++ arch/frv/mb93090-mb00/pci-vdk.c | 6 ++++-- arch/ia64/sn/kernel/io_init.c | 1 + arch/microblaze/pci/pci-common.c | 1 + arch/mips/pci/pci.c | 1 + arch/mn10300/unit-asb2305/pci.c | 5 ++++- arch/s390/pci/pci.c | 2 +- arch/sh/drivers/pci/pci.c | 1 + arch/sparc/kernel/leon_pci.c | 1 + arch/tile/kernel/pci.c | 2 ++ arch/tile/kernel/pci_gx.c | 2 ++ arch/x86/pci/common.c | 1 + arch/xtensa/kernel/pci.c | 2 ++ drivers/pci/host/pci-xgene.c | 1 + drivers/pci/probe.c | 1 - 15 files changed, 24 insertions(+), 5 deletions(-) diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 076c35c..97f9730 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -334,6 +334,8 @@ common_init_pci(void) bus = pci_scan_root_bus(NULL, next_busno, alpha_mv.pci_ops, hose, &resources); + if (bus) + pci_bus_add_devices(bus); hose->bus = bus; hose->need_domain_info = need_domain_info; next_busno = bus->busn_res.end + 1; diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c index efa5d65..2b36044 100644 --- a/arch/frv/mb93090-mb00/pci-vdk.c +++ b/arch/frv/mb93090-mb00/pci-vdk.c @@ -316,6 +316,7 @@ void pcibios_fixup_bus(struct pci_bus *bus) int __init pcibios_init(void) { + struct pci_bus *bus; struct pci_ops *dir = NULL; LIST_HEAD(resources); @@ -383,12 +384,13 @@ int __init pcibios_init(void) printk("PCI: Probing PCI hardware\n"); pci_add_resource(&resources, &pci_ioport_resource); pci_add_resource(&resources, &pci_iomem_resource); - pci_scan_root_bus(NULL, 0, pci_root_ops, NULL, &resources); + bus = pci_scan_root_bus(NULL, 0, pci_root_ops, NULL, &resources); pcibios_irq_init(); pcibios_fixup_irqs(); pcibios_resource_survey(); - + if (bus) + pci_bus_add_devices(bus); return 0; } diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index 0b5ce82..63b43a6 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c @@ -272,6 +272,7 @@ sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) kfree(res); kfree(controller); } + pci_bus_add_devices(bus); } /* diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 9037914..651e25d 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -1346,6 +1346,7 @@ static void pcibios_scan_phb(struct pci_controller *hose) hose->bus = bus; hose->last_busno = bus->busn_res.end; + pci_bus_add_devices(bus); } static int __init pcibios_init(void) diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 1bf60b1..f083688 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c @@ -113,6 +113,7 @@ static void pcibios_scanbus(struct pci_controller *hose) if (!pci_has_flag(PCI_PROBE_ONLY)) { pci_bus_size_bridges(bus); pci_bus_assign_resources(bus); + pci_bus_add_devices(bus); } } } diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c index 6b4339f..860aa35 100644 --- a/arch/mn10300/unit-asb2305/pci.c +++ b/arch/mn10300/unit-asb2305/pci.c @@ -345,6 +345,7 @@ void pcibios_fixup_bus(struct pci_bus *bus) */ static int __init pcibios_init(void) { + struct pci_bus *bus; resource_size_t io_offset, mem_offset; LIST_HEAD(resources); @@ -376,11 +377,13 @@ static int __init pcibios_init(void) pci_add_resource_offset(&resources, &pci_ioport_resource, io_offset); pci_add_resource_offset(&resources, &pci_iomem_resource, mem_offset); - pci_scan_root_bus(NULL, 0, &pci_direct_ampci, NULL, &resources); + bus = pci_scan_root_bus(NULL, 0, &pci_direct_ampci, NULL, &resources); pcibios_irq_init(); pcibios_fixup_irqs(); pcibios_resource_survey(); + if (bus) + pci_bus_add_devices(bus); return 0; } diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 552b990..98247f8 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -755,7 +755,7 @@ static int zpci_scan_bus(struct zpci_dev *zdev) zpci_cleanup_bus_resources(zdev); return -EIO; } - + pci_bus_add_devices(zdev->bus); zdev->bus->max_bus_speed = zdev->max_bus_speed; return 0; } diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 1bc09ee..efc1051 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -69,6 +69,7 @@ static void pcibios_scanbus(struct pci_channel *hose) pci_bus_size_bridges(bus); pci_bus_assign_resources(bus); + pci_bus_add_devices(bus); } else { pci_free_resource_list(&resources); } diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c index 899b720..2971076 100644 --- a/arch/sparc/kernel/leon_pci.c +++ b/arch/sparc/kernel/leon_pci.c @@ -40,6 +40,7 @@ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) /* Assign devices with resources */ pci_assign_unassigned_resources(); + pci_bus_add_devices(root_bus); } else { pci_free_resource_list(&resources); } diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c index 1f80a88..007466e 100644 --- a/arch/tile/kernel/pci.c +++ b/arch/tile/kernel/pci.c @@ -308,6 +308,8 @@ int __init pcibios_init(void) pci_add_resource(&resources, &iomem_resource); bus = pci_scan_root_bus(NULL, 0, controller->ops, controller, &resources); + if (bus) + pci_bus_add_devices(bus); 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 e39f9c5..3f8fb2c 100644 --- a/arch/tile/kernel/pci_gx.c +++ b/arch/tile/kernel/pci_gx.c @@ -889,6 +889,8 @@ int __init pcibios_init(void) controller->first_busno = next_busno; bus = pci_scan_root_bus(NULL, next_busno, controller->ops, controller, &resources); + if (bus) + pci_bus_add_devices(bus); controller->root_bus = bus; next_busno = bus->busn_res.end + 1; } diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 7b20bcc..300d39e 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -475,6 +475,7 @@ void pcibios_scan_root(int busnum) pci_free_resource_list(&resources); kfree(sd); } + pci_bus_add_devices(bus); } void __init pcibios_set_cache_line_size(void) diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c index 5b34033..f2ae64e 100644 --- a/arch/xtensa/kernel/pci.c +++ b/arch/xtensa/kernel/pci.c @@ -185,6 +185,8 @@ static int __init pcibios_init(void) pci_controller_apertures(pci_ctrl, &resources); bus = pci_scan_root_bus(NULL, pci_ctrl->first_busno, pci_ctrl->ops, pci_ctrl, &resources); + if (bus) + pci_bus_add_devices(bus); pci_ctrl->bus = bus; pci_ctrl->last_busno = bus->busn_res.end; if (next_busno <= pci_ctrl->last_busno) diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c index 9ecabfa..c17afe5 100644 --- a/drivers/pci/host/pci-xgene.c +++ b/drivers/pci/host/pci-xgene.c @@ -635,6 +635,7 @@ static int xgene_pcie_probe_bridge(struct platform_device *pdev) if (!bus) return -ENOMEM; + pci_bus_add_devices(bus); platform_set_drvdata(pdev, port); return 0; } diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 79775b5..2ab5a40 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2084,7 +2084,6 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, if (!found) pci_bus_update_busn_res_end(b, max); - pci_bus_add_devices(b); return b; } EXPORT_SYMBOL(pci_scan_root_bus);