aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/pci.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-04-16 18:24:33 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:24:33 -0400
commitdfbacdc1a0b568dfa69fb2c1b39b608074001083 (patch)
treef63fdb5db967253e46472ff776d1e22c38cee16e /arch/ppc64/kernel/pci.c
parent7bbd827750e630003896c96d0212962276ee5d91 (diff)
[PATCH] ppc64: Fix semantics of __ioremap
This patch fixes ppc64 __ioremap() so that it stops adding implicitely _PAGE_GUARDED when the cache is not writeback, and instead, let the callers provide the flag they want here. This allows things like framebuffers to explicitely request a non-cacheable and non-guarded mapping which is more efficient for that type of memory without side effects. The patch also fixes all current callers to add _PAGE_GUARDED except btext, which is fine without it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc64/kernel/pci.c')
-rw-r--r--arch/ppc64/kernel/pci.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index fdd8f7869a6..be3cc387c1e 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -547,8 +547,9 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
547 if (range == NULL || (rlen < sizeof(struct isa_range))) { 547 if (range == NULL || (rlen < sizeof(struct isa_range))) {
548 printk(KERN_ERR "no ISA ranges or unexpected isa range size," 548 printk(KERN_ERR "no ISA ranges or unexpected isa range size,"
549 "mapping 64k\n"); 549 "mapping 64k\n");
550 __ioremap_explicit(phb_io_base_phys, (unsigned long)phb_io_base_virt, 550 __ioremap_explicit(phb_io_base_phys,
551 0x10000, _PAGE_NO_CACHE); 551 (unsigned long)phb_io_base_virt,
552 0x10000, _PAGE_NO_CACHE | _PAGE_GUARDED);
552 return; 553 return;
553 } 554 }
554 555
@@ -576,7 +577,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
576 577
577 __ioremap_explicit(phb_io_base_phys, 578 __ioremap_explicit(phb_io_base_phys,
578 (unsigned long) phb_io_base_virt, 579 (unsigned long) phb_io_base_virt,
579 size, _PAGE_NO_CACHE); 580 size, _PAGE_NO_CACHE | _PAGE_GUARDED);
580 } 581 }
581} 582}
582 583
@@ -692,7 +693,7 @@ void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose,
692 struct resource *res; 693 struct resource *res;
693 694
694 hose->io_base_virt = __ioremap(hose->io_base_phys, size, 695 hose->io_base_virt = __ioremap(hose->io_base_phys, size,
695 _PAGE_NO_CACHE); 696 _PAGE_NO_CACHE | _PAGE_GUARDED);
696 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n", 697 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
697 hose->global_number, hose->io_base_phys, 698 hose->global_number, hose->io_base_phys,
698 (unsigned long) hose->io_base_virt); 699 (unsigned long) hose->io_base_virt);
@@ -780,7 +781,8 @@ int remap_bus_range(struct pci_bus *bus)
780 if (get_bus_io_range(bus, &start_phys, &start_virt, &size)) 781 if (get_bus_io_range(bus, &start_phys, &start_virt, &size))
781 return 1; 782 return 1;
782 printk("mapping IO %lx -> %lx, size: %lx\n", start_phys, start_virt, size); 783 printk("mapping IO %lx -> %lx, size: %lx\n", start_phys, start_virt, size);
783 if (__ioremap_explicit(start_phys, start_virt, size, _PAGE_NO_CACHE)) 784 if (__ioremap_explicit(start_phys, start_virt, size,
785 _PAGE_NO_CACHE | _PAGE_GUARDED))
784 return 1; 786 return 1;
785 787
786 return 0; 788 return 0;