aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 15:54:22 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 15:54:22 -0800
commitd5c67bac833c6c9cc713f6a27daa77dcba898dd8 (patch)
treef8e405da36b2ad15a8f8171115243228b6cbb4da /arch/mips/mm/cache.c
parent989b0b930218661b504bbb056b309e2c7bcdfb86 (diff)
parentcc2d6f701bed8b5f120314e4df854827d8bac558 (diff)
downloadkernel_samsung_smdk4412-d5c67bac833c6c9cc713f6a27daa77dcba898dd8.zip
kernel_samsung_smdk4412-d5c67bac833c6c9cc713f6a27daa77dcba898dd8.tar.gz
kernel_samsung_smdk4412-d5c67bac833c6c9cc713f6a27daa77dcba898dd8.tar.bz2
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: [MIPS] BCM47XX: Use new SSB SPROM data structure [MIPS] WGT634U: Register MTD as platform device. [MIPS] BCM47xx: Add defconfig file. [MIPS] RM: fix EISA=n compilation [MIPS] PCI: Coding style fixes for pcibios_enable_resources. [MIPS] PCI: Port i386 PCI fixes. [MIPS] Qemu: finish platform removal [MIPS] Wire up the timerfd_*() o32 system calls [MIPS] IP28: Add defconfig file [MIPS] SB1: Fix CONFIG_SIBYTE_DMA_PAGEOPS build failure. [MIPS] BCM1480: Remove stray function call resulting in infinite recursion [MIPS] Fix buggy invocations of kmap_coherent() [MIPS] Fix broken rm7000/rm9000 interrupt handling [MIPS] Handle I-cache coherency in flush_cache_range() [MIPS] IP27: Add missing ~ in DMA code. [MIPS] Use find_task_by_vpid in system calls
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 81f30ac..6a24651 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);
}
}