From b94b03deb196483fa7f99c4b73cd305aa2da4ea1 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Thu, 31 Jul 2008 15:24:13 +1000 Subject: [PATCH] --- yaml --- r: 108127 b: refs/heads/master c: 8db13a0e1e87ae2741ca1677caa90e9592c4cc43 h: refs/heads/master i: 108125: 8af4b6cef085abd6e335cee1fe5bcd21925d1f38 108123: 59615eb0b2d0c823fa7a72c380fb8000a80ca4e1 108119: 6884fd28786acccc13e0621f8c37e54e41a78ec8 108111: f99cd6c97bd84ec088b1f7dd8a59b115f60c997f 108095: 002862366561b15b37731d616ff8a9ba1bbb10ad v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/pci-common.c | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index fb86481de68b..7c086bb4558c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b79998fc2e1144919b6b02acbd407a5db1f80ac0 +refs/heads/master: 8db13a0e1e87ae2741ca1677caa90e9592c4cc43 diff --git a/trunk/arch/powerpc/kernel/pci-common.c b/trunk/arch/powerpc/kernel/pci-common.c index 224e9a11765c..ea0c61e09b76 100644 --- a/trunk/arch/powerpc/kernel/pci-common.c +++ b/trunk/arch/powerpc/kernel/pci-common.c @@ -650,11 +650,18 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, } } - /* Out of paranoia, let's put the ISA hole last if any */ - if (isa_hole >= 0 && memno > 0 && isa_hole != (memno-1)) { - struct resource tmp = hose->mem_resources[isa_hole]; - hose->mem_resources[isa_hole] = hose->mem_resources[memno-1]; - hose->mem_resources[memno-1] = tmp; + /* If there's an ISA hole and the pci_mem_offset is -not- matching + * the ISA hole offset, then we need to remove the ISA hole from + * the resource list for that brige + */ + if (isa_hole >= 0 && hose->pci_mem_offset != isa_mb) { + unsigned int next = isa_hole + 1; + printk(KERN_INFO " Removing ISA hole at 0x%016llx\n", isa_mb); + if (next < memno) + memmove(&hose->mem_resources[isa_hole], + &hose->mem_resources[next], + sizeof(struct resource) * (memno - next)); + hose->mem_resources[--memno].flags = 0; } }