linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [POWERPC] Always hookup PHB IO resource even when empty
@ 2008-01-21  0:32 Benjamin Herrenschmidt
  2008-01-21  0:37 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2008-01-21  0:32 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

We must always hookup the pci_bus resource 0 to the PHB io_resource even
if the later is empty (the bus has no IO support). Otherwise, some other
code will end up hooking it up to something bogus and the resource tree
will end up being broken.

This fixes boot on QS20 Cell blades where the IDE driver failed to allocate
the IO resources due to breakage of the resource tree.

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

This is for 2.6.25, fixes a bug in my PCI rework.
 
 arch/powerpc/kernel/pci_64.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

--- linux-merge.orig/arch/powerpc/kernel/pci_64.c	2008-01-21 11:27:41.000000000 +1100
+++ linux-merge/arch/powerpc/kernel/pci_64.c	2008-01-21 11:28:07.000000000 +1100
@@ -357,7 +357,6 @@ void __devinit scan_phb(struct pci_contr
 	struct pci_bus *bus;
 	struct device_node *node = hose->dn;
 	int i, mode;
-	struct resource *res;
 
 	DBG("PCI: Scanning PHB %s\n", node ? node->full_name : "<NO NAME>");
 
@@ -375,12 +374,10 @@ void __devinit scan_phb(struct pci_contr
 	pcibios_map_io_space(bus);
 
 	/* Wire up PHB bus resources */
-	if (hose->io_resource.flags) {
-		DBG("PCI: PHB IO resource    = %016lx-%016lx [%lx]\n",
-		    hose->io_resource.start, hose->io_resource.end,
-		    hose->io_resource.flags);
-		bus->resource[0] = res = &hose->io_resource;
-	}
+	DBG("PCI: PHB IO resource    = %016lx-%016lx [%lx]\n",
+	    hose->io_resource.start, hose->io_resource.end,
+	    hose->io_resource.flags);
+	bus->resource[0] = &hose->io_resource;
 	for (i = 0; i < 3; ++i) {
 		DBG("PCI: PHB MEM resource %d = %016lx-%016lx [%lx]\n", i,
 		    hose->mem_resources[i].start,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [POWERPC] Always hookup PHB IO resource even when empty
  2008-01-21  0:32 [PATCH] [POWERPC] Always hookup PHB IO resource even when empty Benjamin Herrenschmidt
@ 2008-01-21  0:37 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2008-01-21  0:37 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

On Mon, 2008-01-21 at 11:32 +1100, Benjamin Herrenschmidt wrote:
> We must always hookup the pci_bus resource 0 to the PHB io_resource even
> if the later is empty (the bus has no IO support). Otherwise, some other
> code will end up hooking it up to something bogus and the resource tree
> will end up being broken.
> 
> This fixes boot on QS20 Cell blades where the IDE driver failed to allocate
> the IO resources due to breakage of the resource tree.

Tested-by: Michael Ellerman <michael@ellerman.id.au>

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-21  0:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21  0:32 [PATCH] [POWERPC] Always hookup PHB IO resource even when empty Benjamin Herrenschmidt
2008-01-21  0:37 ` Michael Ellerman

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