X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fpowerpc%2Fkernel%2Fpci-common.c;h=ea0c61e09b7640553cf70c92b184339ff3bfd0bc;hb=e2205a156f4dd727097f7f492bf03aa8920b0071;hp=224e9a11765c9d9088090130b39ac33f72b505ab;hpb=375614422509c98a1f3dbef410206bf81775169b;p=linux-2.6 diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 224e9a1176..ea0c61e09b 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/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; } }