PPC32: Fix __flush_dcache_icache_phys() for Book E
PATCH 1/1 PPC32: Fix __flush_dcache_icache_phys() for Book E
This patch implements/uses __flush_dcache_icache_page() which kmaps on a Book E part, but keeps the existing behavior on other PowerPCs which can disable the MMU. Please apply.
-Matt
arch/ppc/mm/fault.c +1 -2
@@ -227,8 +227,7 @@struct page *page =pte_page (*ptep);if (!test_bit (PG_arch_1, &page->flags)) { -unsigned long phys =page_to_pfn (page) <<PAGE_SHIFT ; -__flush_dcache_icache_phys (phys); +flush_dcache_icache_page (page);set_bit (PG_arch_1, &page->flags); }pte_update (ptep,0 , _PAGE_HWEXEC);
arch/ppc/mm/init.c +11 -1
@@ -572,6 +572,16 @@clear_bit (PG_arch_1, &page->flags); } +void flush_dcache_icache_page (struct page *page) +{ +#ifdef CONFIG_BOOKE +__flush_dcache_icache (kmap (page)); +kunmap (page); +#else +__flush_dcache_icache_phys (page_to_pfn (page) <<PAGE_SHIFT ); +#endif + +}void clear_user_page (void *page,unsigned long vaddr,struct page *pg) {clear_page (page);
@@ -614,7 +624,7 @@if (vma->vm_mm == current->active_mm)__flush_dcache_icache ((void *) address);else -__flush_dcache_icache_phys (pfn <<PAGE_SHIFT ); +flush_dcache_icache_page (page);set_bit (PG_arch_1, &page->flags); } }
include/asm-ppc/cacheflush.h +1 -1
@@ -41,6 +41,6 @@extern void __flush_dcache_icache (void *page_va);extern void __flush_dcache_icache_phys (unsigned long physaddr); - +extern void flush_dcache_icache_page (struct page *page);#endif /* _PPC_CACHEFLUSH_H */ #endif /* __KERNEL__ */