summaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/cache.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2008-02-27 11:07:10 -0800
committerChristoph Lameter <clameter@sgi.com>2008-02-27 11:07:10 -0800
commit9ef64cb4320df821638b508f79aa8b858cca99f0 (patch)
tree4efbf0854234f89c6f4413077ec795fc669b5b0a /arch/mips/mm/cache.c
parent6f157c1d268d5888ca44c589dccd01729c4172f6 (diff)
parent7704a8b6fc4a8f51599eb2af4dcf1e2ac9c7e576 (diff)
downloadkernel-crypto-9ef64cb4320df821638b508f79aa8b858cca99f0.tar.gz
kernel-crypto-9ef64cb4320df821638b508f79aa8b858cca99f0.tar.xz
kernel-crypto-9ef64cb4320df821638b508f79aa8b858cca99f0.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/mips/mm/cache.c')
-rw-r--r--arch/mips/mm/cache.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 81f30ac2bff..6a24651971d 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -92,12 +92,17 @@ EXPORT_SYMBOL(__flush_dcache_page);
void __flush_anon_page(struct page *page, unsigned long vmaddr)
{
- if (pages_do_alias((unsigned long)page_address(page), vmaddr)) {
- void *kaddr;
+ unsigned long addr = (unsigned long) page_address(page);
- kaddr = kmap_coherent(page, vmaddr);
- flush_data_cache_page((unsigned long)kaddr);
- kunmap_coherent();
+ if (pages_do_alias(addr, vmaddr)) {
+ if (page_mapped(page) && !Page_dcache_dirty(page)) {
+ void *kaddr;
+
+ kaddr = kmap_coherent(page, vmaddr);
+ flush_data_cache_page((unsigned long)kaddr);
+ kunmap_coherent();
+ } else
+ flush_data_cache_page(addr);
}
}