aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2015-04-15 20:40:23 -0400
committerScott Wood <scottwood@freescale.com>2015-08-07 23:59:20 -0400
commit2f7d2b74a9dd9140053f143e1c94da0fef3c1109 (patch)
treecc90ce077e6bfa19440953c1914b78e690182403
parent501c8de7b061d2dc0c21a0a79fee3eddf30af8dd (diff)
powerpc/mm: Don't call __flush_dcache_icache_phys() with PA>VA
__flush_dcache_icache_phys() requires the ability to access the memory with the MMU disabled, which means that on a 32-bit system any memory above 4 GiB is inaccessible. In particular, mpc86xx is 32-bit and can have more than 4 GiB of RAM. Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r--arch/powerpc/include/asm/cacheflush.h7
-rw-r--r--arch/powerpc/mm/mem.c14
2 files changed, 13 insertions, 8 deletions
diff --git a/arch/powerpc/include/asm/cacheflush.h b/arch/powerpc/include/asm/cacheflush.h
index 30b35fff2dea..6229e6b6037b 100644
--- a/arch/powerpc/include/asm/cacheflush.h
+++ b/arch/powerpc/include/asm/cacheflush.h
@@ -40,7 +40,12 @@ extern void __flush_dcache_icache(void *page_va);
40extern void flush_dcache_icache_page(struct page *page); 40extern void flush_dcache_icache_page(struct page *page);
41#if defined(CONFIG_PPC32) && !defined(CONFIG_BOOKE) 41#if defined(CONFIG_PPC32) && !defined(CONFIG_BOOKE)
42extern void __flush_dcache_icache_phys(unsigned long physaddr); 42extern void __flush_dcache_icache_phys(unsigned long physaddr);
43#endif /* CONFIG_PPC32 && !CONFIG_BOOKE */ 43#else
44static inline void __flush_dcache_icache_phys(unsigned long physaddr)
45{
46 BUG();
47}
48#endif
44 49
45extern void flush_dcache_range(unsigned long start, unsigned long stop); 50extern void flush_dcache_range(unsigned long start, unsigned long stop);
46#ifdef CONFIG_PPC32 51#ifdef CONFIG_PPC32
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 0f11819d8f1d..e1fe333da946 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -414,17 +414,17 @@ void flush_dcache_icache_page(struct page *page)
414 return; 414 return;
415 } 415 }
416#endif 416#endif
417#ifdef CONFIG_BOOKE 417#if defined(CONFIG_8xx) || defined(CONFIG_PPC64)
418 { 418 /* On 8xx there is no need to kmap since highmem is not supported */
419 __flush_dcache_icache(page_address(page));
420#else
421 if (IS_ENABLED(CONFIG_BOOKE) || sizeof(phys_addr_t) > sizeof(void *)) {
419 void *start = kmap_atomic(page); 422 void *start = kmap_atomic(page);
420 __flush_dcache_icache(start); 423 __flush_dcache_icache(start);
421 kunmap_atomic(start); 424 kunmap_atomic(start);
425 } else {
426 __flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT);
422 } 427 }
423#elif defined(CONFIG_8xx) || defined(CONFIG_PPC64)
424 /* On 8xx there is no need to kmap since highmem is not supported */
425 __flush_dcache_icache(page_address(page));
426#else
427 __flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT);
428#endif 428#endif
429} 429}
430EXPORT_SYMBOL(flush_dcache_icache_page); 430EXPORT_SYMBOL(flush_dcache_icache_page);