From patchwork Wed Jan 29 18:17:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3553411 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8CE90C02DC for ; Wed, 29 Jan 2014 18:18:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98CDC201C7 for ; Wed, 29 Jan 2014 18:18:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EBA4201C0 for ; Wed, 29 Jan 2014 18:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085AbaA2SSE (ORCPT ); Wed, 29 Jan 2014 13:18:04 -0500 Received: from mail-ie0-f181.google.com ([209.85.223.181]:36415 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753052AbaA2SR7 (ORCPT ); Wed, 29 Jan 2014 13:17:59 -0500 Received: by mail-ie0-f181.google.com with SMTP id to1so2436380ieb.40 for ; Wed, 29 Jan 2014 10:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=yQDleifRgCpuDgd1jxxwcRrZ2PsLgZAzMmz+C4P0QtU=; b=OPgpyEYLhRD8MkkzF77CM1EVc9V78d1YhXXE6EcMwOJAu/Glpq1Jj1pJU9uXsNMr48 /of1quZ7CNX8ENbjX7SI31jiloyxlZRLcArzomY2i6jgp/dnIOWU4umPdlLTFfONU8mi OvFC+2CwN9sDg1CcsMwAhXNcSAICQdfardrItmxhwjkQS0wEtIAxGzzFCxdCuXRsph+T 7fIo6JjUD1Te2gxaXcodZmzdQneW44K3FzzIqNdyqiIYhl85GeKKd605fKYQVttvFeO6 RK3ZUB2Uvs3WnE9qdzcTEuDHkJX6R+WUUfuCCy0KRdrqZbTCkMKn4tqPEr1PaXnHnNns +XGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=yQDleifRgCpuDgd1jxxwcRrZ2PsLgZAzMmz+C4P0QtU=; b=OauGv1/vS3w6P18twb07xf1KfDowYPVXIeEpuOqps0l6kggaN1QA6aDWD2OrTIQgNZ PT2VPqX08jyZMkO54Ct+8Dq2/LnLn9V/56HU9e0qDWwKyYUwTuSg1HEOn4BCODJS7dpN dw68YokHhx0YO//fGhuB9DQ6WfT6cP7itubE9fxxOGV41fK6dbPHINQAz8cskD4rl2VR 2pKt4DrOJ4jnGCzx6evprnMvlC9uHXDvqh9NkBCwV01/XkKBZVz8+/ck75Hsd++KR1mW lRcqw+W+/UnlBkYztcBanAfY3RiMqVNhAGihS24FB6Ckwt9flnPjWTM6bUXNp2s3E/Na ceUA== X-Gm-Message-State: ALoCoQkgSIiYoHGjtCxWvCGzf3U7AI9XGWW2xk7wNQxdRjGVR/+WjVopHE1EKnuikjfclyXkxqOOnNWD2meujHxf3EAoMamKYIeK4gDm7Pf1opptJceQG9OqpfoxaqFMUK5CteVDU1kaJIANb9TV/Mf5cLQfz8jKbYlYdTlo2eGCgbcbbKTdiY/a1GAqHu/pF58gAGaQu2McYcwI9yj9i1gxRjiGnW+LyuxBxo024zIexAznUZ58o7E= X-Received: by 10.50.114.4 with SMTP id jc4mr30069035igb.0.1391019478562; Wed, 29 Jan 2014 10:17:58 -0800 (PST) Received: from localhost ([172.29.123.160]) by mx.google.com with ESMTPSA id kz4sm11145547igb.4.2014.01.29.10.17.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 10:17:57 -0800 (PST) Subject: [PATCH 04/17] x86/PCI: Merge pci_scan_bus_on_node() into pcibios_scan_root() To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, x86@kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 29 Jan 2014 11:17:56 -0700 Message-ID: <20140129181756.15476.8169.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140129174106.15476.7075.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140129174106.15476.7075.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 pci_scan_bus_on_node() is only called by pcibios_scan_root(). This merges pci_scan_bus_on_node() into pcibios_scan_root() and removes pci_scan_bus_on_node(). Signed-off-by: Bjorn Helgaas --- arch/x86/include/asm/pci.h | 4 ---- arch/x86/pci/common.c | 49 +++++++++++++++++--------------------------- 2 files changed, 19 insertions(+), 34 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 4e891abf8b48..b52f9c0ec5fb 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -26,10 +26,6 @@ extern int pci_routeirq; extern int noioapicquirk; extern int noioapicreroute; -/* scan a bus after allocating a pci_sysdata for it */ -extern struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, - int node); - #ifdef CONFIG_PCI #ifdef CONFIG_PCI_DOMAINS diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index f530c7e93250..52ad00c2e198 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -458,8 +458,25 @@ void __init dmi_check_pciprobe(void) struct pci_bus *pcibios_scan_root(int busnum) { - return pci_scan_bus_on_node(busnum, &pci_root_ops, - get_mp_bus_to_node(busnum)); + struct pci_bus *bus; + struct pci_sysdata *sd; + LIST_HEAD(resources); + + sd = kzalloc(sizeof(*sd), GFP_KERNEL); + if (!sd) { + printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busnum); + return NULL; + } + sd->node = get_mp_bus_to_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); + if (!bus) { + pci_free_resource_list(&resources); + kfree(sd); + } + + return bus; } void __init pcibios_set_cache_line_size(void) @@ -669,34 +686,6 @@ int pci_ext_cfg_avail(void) return 0; } -struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node) -{ - LIST_HEAD(resources); - struct pci_bus *bus = NULL; - struct pci_sysdata *sd; - - /* - * Allocate per-root-bus (not per bus) arch-specific data. - * TODO: leak; this memory is never freed. - * It's arguable whether it's worth the trouble to care. - */ - sd = kzalloc(sizeof(*sd), GFP_KERNEL); - if (!sd) { - printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busno); - return NULL; - } - sd->node = node; - x86_pci_root_bus_resources(busno, &resources); - printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busno); - bus = pci_scan_root_bus(NULL, busno, ops, sd, &resources); - if (!bus) { - pci_free_resource_list(&resources); - kfree(sd); - } - - return bus; -} - /* * NUMA info for PCI busses *