diff options
Diffstat (limited to 'arch/mips/mm/cache.c')
-rw-r--r-- | arch/mips/mm/cache.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 81f30ac2bff9..6a24651971df 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c | |||
@@ -92,12 +92,17 @@ EXPORT_SYMBOL(__flush_dcache_page); | |||
92 | 92 | ||
93 | void __flush_anon_page(struct page *page, unsigned long vmaddr) | 93 | void __flush_anon_page(struct page *page, unsigned long vmaddr) |
94 | { | 94 | { |
95 | if (pages_do_alias((unsigned long)page_address(page), vmaddr)) { | 95 | unsigned long addr = (unsigned long) page_address(page); |
96 | void *kaddr; | ||
97 | 96 | ||
98 | kaddr = kmap_coherent(page, vmaddr); | 97 | if (pages_do_alias(addr, vmaddr)) { |
99 | flush_data_cache_page((unsigned long)kaddr); | 98 | if (page_mapped(page) && !Page_dcache_dirty(page)) { |
100 | kunmap_coherent(); | 99 | void *kaddr; |
100 | |||
101 | kaddr = kmap_coherent(page, vmaddr); | ||
102 | flush_data_cache_page((unsigned long)kaddr); | ||
103 | kunmap_coherent(); | ||
104 | } else | ||
105 | flush_data_cache_page(addr); | ||
101 | } | 106 | } |
102 | } | 107 | } |
103 | 108 | ||