diff options
author | Scott Wood <scottwood@freescale.com> | 2015-04-15 19:40:23 -0500 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2015-08-07 22:59:20 -0500 |
commit | 2f7d2b74a9dd9140053f143e1c94da0fef3c1109 (patch) | |
tree | cc90ce077e6bfa19440953c1914b78e690182403 /arch/powerpc/mm/mem.c | |
parent | 501c8de7b061d2dc0c21a0a79fee3eddf30af8dd (diff) | |
download | op-kernel-dev-2f7d2b74a9dd9140053f143e1c94da0fef3c1109.zip op-kernel-dev-2f7d2b74a9dd9140053f143e1c94da0fef3c1109.tar.gz |
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>
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r-- | arch/powerpc/mm/mem.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 0f11819..e1fe333 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) return; } #endif -#ifdef CONFIG_BOOKE - { +#if defined(CONFIG_8xx) || defined(CONFIG_PPC64) + /* On 8xx there is no need to kmap since highmem is not supported */ + __flush_dcache_icache(page_address(page)); +#else + if (IS_ENABLED(CONFIG_BOOKE) || sizeof(phys_addr_t) > sizeof(void *)) { void *start = kmap_atomic(page); __flush_dcache_icache(start); kunmap_atomic(start); + } else { + __flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT); } -#elif defined(CONFIG_8xx) || defined(CONFIG_PPC64) - /* On 8xx there is no need to kmap since highmem is not supported */ - __flush_dcache_icache(page_address(page)); -#else - __flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT); #endif } EXPORT_SYMBOL(flush_dcache_icache_page); |