[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>
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index fdd8f78..be3cc38 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -547,8 +547,9 @@
if (range == NULL || (rlen < sizeof(struct isa_range))) {
printk(KERN_ERR "no ISA ranges or unexpected isa range size,"
"mapping 64k\n");
- __ioremap_explicit(phb_io_base_phys, (unsigned long)phb_io_base_virt,
- 0x10000, _PAGE_NO_CACHE);
+ __ioremap_explicit(phb_io_base_phys,
+ (unsigned long)phb_io_base_virt,
+ 0x10000, _PAGE_NO_CACHE | _PAGE_GUARDED);
return;
}
@@ -576,7 +577,7 @@
__ioremap_explicit(phb_io_base_phys,
(unsigned long) phb_io_base_virt,
- size, _PAGE_NO_CACHE);
+ size, _PAGE_NO_CACHE | _PAGE_GUARDED);
}
}
@@ -692,7 +693,7 @@
struct resource *res;
hose->io_base_virt = __ioremap(hose->io_base_phys, size,
- _PAGE_NO_CACHE);
+ _PAGE_NO_CACHE | _PAGE_GUARDED);
DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
hose->global_number, hose->io_base_phys,
(unsigned long) hose->io_base_virt);
@@ -780,7 +781,8 @@
if (get_bus_io_range(bus, &start_phys, &start_virt, &size))
return 1;
printk("mapping IO %lx -> %lx, size: %lx\n", start_phys, start_virt, size);
- if (__ioremap_explicit(start_phys, start_virt, size, _PAGE_NO_CACHE))
+ if (__ioremap_explicit(start_phys, start_virt, size,
+ _PAGE_NO_CACHE | _PAGE_GUARDED))
return 1;
return 0;