linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <linuxppc-dev@ozlabs.org>
Subject: [PATCH 7/10] powerpc/pci: Make pcibios_allocate_bus_resources more robust
Date: Tue, 28 Oct 2008 16:48:44 +1100	[thread overview]
Message-ID: <20081028054944.77073DDF6D@ozlabs.org> (raw)
In-Reply-To: <1225172895.217185.958686212130.qpush@grosgo>

To properly fix PCI hotplug, it's useful to be able to make
the fixup passes on all devices whether they were just hot
plugged or already there.

However, pcibios_allocate_bus_resources() wouldn't cope well
with being called twice for a given bus. This patch makes it
ignore resources that have already been allocated, along with
adding a bit of debug output.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 arch/powerpc/kernel/pci-common.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- linux-work.orig/arch/powerpc/kernel/pci-common.c	2008-10-28 14:04:45.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci-common.c	2008-10-28 14:04:57.000000000 +1100
@@ -1245,9 +1245,12 @@ static void pcibios_allocate_bus_resourc
 	int i;
 	struct resource *res, *pr;
 
+	pr_debug("PCI: Allocating bus resources for %04x:%02x...\n",
+		 pci_domain_nr(bus), bus->number);
+
 	for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
 		if ((res = bus->resource[i]) == NULL || !res->flags
-		    || res->start > res->end)
+		    || res->start > res->end || res->parent)
 			continue;
 		if (bus->parent == NULL)
 			pr = (res->flags & IORESOURCE_IO) ?

  parent reply	other threads:[~2008-10-28  5:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28  5:48 [PATCH 0/10] powerpc/pci: Fix PCI Hotplug Benjamin Herrenschmidt
2008-10-28  5:48 ` [PATCH 1/10] powerpc/pci: Properly allocate bus resources for hotplug PHBs Benjamin Herrenschmidt
2008-10-28  5:48 ` [PATCH 2/10] powerpc/pci: Cleanup debug printk's Benjamin Herrenschmidt
2008-10-28  5:48 ` [PATCH 3/10] powerpc/pci: Use commont PHB resource hookup Benjamin Herrenschmidt
2008-10-28  5:48 ` [PATCH 4/10] powerpc/pci: Remove pcibios_do_bus_setup() Benjamin Herrenschmidt
2008-10-28  5:48 ` [PATCH 5/10] powerpc/pci: Split pcibios_fixup_bus() into bus setup and devices setup Benjamin Herrenschmidt
2008-10-28  5:48 ` [PATCH 6/10] powerpc/eeh: Make EEH device add/remove more robust Benjamin Herrenschmidt
2008-10-28  5:48 ` Benjamin Herrenschmidt [this message]
2008-10-28  5:48 ` [PATCH 8/10] powerpc/pci: Fix unmapping of IO space on 64-bit Benjamin Herrenschmidt
2008-10-28  5:48 ` [PATCH 9/10] powerpc/pci: Fix various pseries PCI Hotplug issues Benjamin Herrenschmidt
2008-11-05 11:34   ` Paul Mackerras
2008-11-05 20:30     ` Benjamin Herrenschmidt
2008-10-28  5:48 ` [PATCH 10/10] powerpc/pci: Cosmetic cleanups of pci-common.c Benjamin Herrenschmidt
2008-10-28  5:54 ` [PATCH 0/10] powerpc/pci: Fix PCI Hotplug Benjamin Herrenschmidt

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=20081028054944.77073DDF6D@ozlabs.org \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.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).