diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-19 15:54:22 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-19 15:54:22 -0800 |
commit | d5c67bac833c6c9cc713f6a27daa77dcba898dd8 (patch) | |
tree | f8e405da36b2ad15a8f8171115243228b6cbb4da /arch/mips/mm/cache.c | |
parent | 989b0b930218661b504bbb056b309e2c7bcdfb86 (diff) | |
parent | cc2d6f701bed8b5f120314e4df854827d8bac558 (diff) |
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.c | 15 |
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); } } |