diff options
author | Ilya Loginov <isloginov@gmail.com> | 2009-11-26 03:16:19 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-11-26 03:16:19 -0500 |
commit | 2d4dc890b5c8fabd818a8586607e6843c4375e62 (patch) | |
tree | 9976ed7b0eed0056f8289aeb6a2b0abf8c940454 /arch/sparc | |
parent | 3586e917f2c7df769d173c4ec99554cb40a911e5 (diff) |
block: add helpers to run flush_dcache_page() against a bio and a request's pages
Mtdblock driver doesn't call flush_dcache_page for pages in request. So,
this causes problems on architectures where the icache doesn't fill from
the dcache or with dcache aliases. The patch fixes this.
The ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE symbol was introduced to avoid
pointless empty cache-thrashing loops on architectures for which
flush_dcache_page() is a no-op. Every architecture was provided with this
flush pages on architectires where ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is
equal 1 or do nothing otherwise.
See "fix mtd_blkdevs problem with caches on some architectures" discussion
on LKML for more information.
Signed-off-by: Ilya Loginov <isloginov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Peter Horton <phorton@bitbox.co.uk>
Cc: "Ed L. Cashin" <ecashin@coraid.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/cacheflush_32.h | 1 | ||||
-rw-r--r-- | arch/sparc/include/asm/cacheflush_64.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/cacheflush_32.h b/arch/sparc/include/asm/cacheflush_32.h index 68ac10910271..2e468773f250 100644 --- a/arch/sparc/include/asm/cacheflush_32.h +++ b/arch/sparc/include/asm/cacheflush_32.h | |||
@@ -75,6 +75,7 @@ BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long) | |||
75 | 75 | ||
76 | extern void sparc_flush_page_to_ram(struct page *page); | 76 | extern void sparc_flush_page_to_ram(struct page *page); |
77 | 77 | ||
78 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 | ||
78 | #define flush_dcache_page(page) sparc_flush_page_to_ram(page) | 79 | #define flush_dcache_page(page) sparc_flush_page_to_ram(page) |
79 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 80 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
80 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 81 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
diff --git a/arch/sparc/include/asm/cacheflush_64.h b/arch/sparc/include/asm/cacheflush_64.h index c43321729b3b..b95384033e89 100644 --- a/arch/sparc/include/asm/cacheflush_64.h +++ b/arch/sparc/include/asm/cacheflush_64.h | |||
@@ -37,6 +37,7 @@ extern void flush_dcache_page_all(struct mm_struct *mm, struct page *page); | |||
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | extern void __flush_dcache_range(unsigned long start, unsigned long end); | 39 | extern void __flush_dcache_range(unsigned long start, unsigned long end); |
40 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 | ||
40 | extern void flush_dcache_page(struct page *page); | 41 | extern void flush_dcache_page(struct page *page); |
41 | 42 | ||
42 | #define flush_icache_page(vma, pg) do { } while(0) | 43 | #define flush_icache_page(vma, pg) do { } while(0) |