linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Yijing Wang <wangyijing@huawei.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Liviu Dudau <liviu@dudau.co.uk>, Tony Luck <tony.luck@intel.com>,
	Russell King <linux@arm.linux.org.uk>,
	linux-pci@vger.kernel.org, x86@kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-ia64@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 3/5] PCI: Use pci_scan_bus_simple() in simple scene.
Date: Wed, 19 Nov 2014 13:28:50 +0100	[thread overview]
Message-ID: <3577231.2krnYe8yCU@wuerfel> (raw)
In-Reply-To: <1416382369-13587-4-git-send-email-wangyijing@huawei.com>

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 <wangyijing@huawei.com>
> 

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<---

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;
 	}
 


  reply	other threads:[~2014-11-19 12:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19  7:32 [PATCH 0/5] PCI scan interfaces clean up Yijing Wang
2014-11-19  7:32 ` [PATCH 1/5] PCI: Rip out pci_bus_add_devices() from pci_scan_bus() Yijing Wang
2014-11-19  7:32 ` [PATCH 2/5] PCI: Introduce pci_scan_bus_simple() Yijing Wang
2014-11-19  7:32 ` [PATCH 3/5] PCI: Use pci_scan_bus_simple() in simple scene Yijing Wang
2014-11-19 12:28   ` Arnd Bergmann [this message]
2014-11-20  1:53     ` Yijing Wang
2014-11-19  7:32 ` [PATCH 4/5] PCI: Remove pci_scan_bus() and pci_scan_bus_parented() Yijing Wang
2014-11-19  7:32 ` [PATCH 5/5] PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus() Yijing Wang
2014-11-19 11:49   ` Lorenzo Pieralisi
2014-11-20  1:14     ` Yijing Wang
2014-11-19 12:11   ` Arnd Bergmann
2014-11-19 19:03     ` Liviu Dudau
2014-11-20  1:49     ` Yijing Wang

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=3577231.2krnYe8yCU@wuerfel \
    --to=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=liviu@dudau.co.uk \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=wangyijing@huawei.com \
    --cc=x86@kernel.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).