From patchwork Wed Nov 19 12:28:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 5336941 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 81CF79F2ED for ; Wed, 19 Nov 2014 12:29:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1F3D201BB for ; Wed, 19 Nov 2014 12:29:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C176B201E4 for ; Wed, 19 Nov 2014 12:29:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754023AbaKSM3R (ORCPT ); Wed, 19 Nov 2014 07:29:17 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:64518 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753988AbaKSM3Q (ORCPT ); Wed, 19 Nov 2014 07:29:16 -0500 Received: from wuerfel.localnet (HSI-KBW-149-172-15-242.hsi13.kabel-badenwuerttemberg.de [149.172.15.242]) by mrelayeu.kundenserver.de (node=mreue102) with ESMTP (Nemesis) id 0McWQK-1XZXWd1mlc-00Hfr5; Wed, 19 Nov 2014 13:28:51 +0100 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Yijing Wang , Bjorn Helgaas , Liviu Dudau , Tony Luck , Russell King , linux-pci@vger.kernel.org, x86@kernel.org, Geert Uytterhoeven , linux-ia64@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH 3/5] PCI: Use pci_scan_bus_simple() in simple scene. Date: Wed, 19 Nov 2014 13:28:50 +0100 Message-ID: <3577231.2krnYe8yCU@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1416382369-13587-4-git-send-email-wangyijing@huawei.com> References: <1416382369-13587-1-git-send-email-wangyijing@huawei.com> <1416382369-13587-4-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Provags-ID: V02:K0:9sKocqXWjEAX/CgTPnXpKXfdS96eencqIH6aeLzqIi+ 6PERVz4P9mqxYBoyMR2SmzquASziOtvQuJ2fWeMvbavFQL5iXe IyKSuSY7GHMhSOAVg07h8OpyBR6sDABtuLslPVeEmJm5aK0wy8 tDobzHc5IOVxZSRqSj0Y63YzQNUG2woT/xHv5xrBboju6vfKJz mmKTWTQpBXTi3vuqgt9UrxHciG+4zHeFVRET/2A15jP2pfRK0q m/fK5pJqDDBgTDsusL9q9vvsGf+WCCQ01Rpz2p/qZU8EC/XoBY WyFULhaIwwA1t0EutRLcd3laGNePS1zHsFa9UJ0qSNoPoDS5ee Ik28N9KtpxgrIPBGyAUE= X-UI-Out-Filterresults: notjunk:1; Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 On Wednesday 19 November 2014 15:32:47 Yijing Wang wrote: > Use pci_scan_bus_simple() to scan pci buses with > the default IO/MEM/BUS resources. Use it instead > of pci_scan_bus() and pci_scan_bus_parented(). > > Signed-off-by: Yijing Wang > I think we should replace pci_scan_bus_parented() with something better by making the xen code use pci_scan_root_bus() (see below for a draft patch). After that we no longer need the 'parent' argument here and we can just keep using the pci_scan_bus() function for the legacy users, or rename it if that helps. Arnd 8<--- --- 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/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c index 116ca3746adb..45a4843a608a 100644 --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -448,6 +448,7 @@ static int pcifront_scan_root(struct pcifront_device *pdev, struct pci_bus *b; struct pcifront_sd *sd = NULL; struct pci_bus_entry *bus_entry = NULL; + LIST_HEAD(resources); int err = 0; #ifndef CONFIG_PCI_DOMAINS @@ -470,17 +471,20 @@ static int pcifront_scan_root(struct pcifront_device *pdev, err = -ENOMEM; goto err_out; } + pci_add_resource(&resources, &ioport_resource); + pci_add_resource(&resources, &iomem_resource); pcifront_init_sd(sd, domain, bus, pdev); pci_lock_rescan_remove(); - b = pci_scan_bus_parented(&pdev->xdev->dev, bus, - &pcifront_bus_ops, sd); + b = pci_scan_root_bus(&pdev->xdev->dev, bus, &pcifront_bus_ops, sd, + &resources); if (!b) { dev_err(&pdev->xdev->dev, "Error creating PCI Frontend Bus!\n"); err = -ENOMEM; pci_unlock_rescan_remove(); + pci_free_resource_list(&resources); goto err_out; }