aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-31 01:24:13 -0400
committerPaul Mackerras <paulus@samba.org>2008-08-10 20:09:56 -0400
commit8db13a0e1e87ae2741ca1677caa90e9592c4cc43 (patch)
treeeefe3cd37ea1dc33d0878ecb9cb2f5f4dfc04105 /arch/powerpc
parentb79998fc2e1144919b6b02acbd407a5db1f80ac0 (diff)
powerpc/pci: Don't keep ISA memory hole resources in the tree
When we have an ISA memory hole (ie, a PCI window that allows us to generate PCI memory cycles at low PCI address) mixed with other resources using a different CPU <=> PCI mapping, we must not keep the ISA hole in the bridge resource list. If we do, things might start trying to allocate device resources in there and will get the PCI addresses wrong. This fixes it by arranging to remove the ISA memory hole resource in this case. This fixes various cases of PCMCIA breakage on PowerBooks using the MPC106 "grackle" bridge. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/pci-common.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 224e9a11765c..ea0c61e09b76 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,
650 } 650 }
651 } 651 }
652 652
653 /* Out of paranoia, let's put the ISA hole last if any */ 653 /* If there's an ISA hole and the pci_mem_offset is -not- matching
654 if (isa_hole >= 0 && memno > 0 && isa_hole != (memno-1)) { 654 * the ISA hole offset, then we need to remove the ISA hole from
655 struct resource tmp = hose->mem_resources[isa_hole]; 655 * the resource list for that brige
656 hose->mem_resources[isa_hole] = hose->mem_resources[memno-1]; 656 */
657 hose->mem_resources[memno-1] = tmp; 657 if (isa_hole >= 0 && hose->pci_mem_offset != isa_mb) {
658 unsigned int next = isa_hole + 1;
659 printk(KERN_INFO " Removing ISA hole at 0x%016llx\n", isa_mb);
660 if (next < memno)
661 memmove(&hose->mem_resources[isa_hole],
662 &hose->mem_resources[next],
663 sizeof(struct resource) * (memno - next));
664 hose->mem_resources[--memno].flags = 0;
658 } 665 }
659} 666}
660 667