block: add helpers to run flush_dcache_page() against a bio and a request's pages
authorIlya Loginov <isloginov@gmail.com>
Thu, 26 Nov 2009 08:16:19 +0000 (09:16 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 26 Nov 2009 08:16:19 +0000 (09:16 +0100)
commit2d4dc890b5c8fabd818a8586607e6843c4375e62
tree9976ed7b0eed0056f8289aeb6a2b0abf8c940454
parent3586e917f2c7df769d173c4ec99554cb40a911e5
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>
29 files changed:
arch/alpha/include/asm/cacheflush.h
arch/arm/include/asm/cacheflush.h
arch/avr32/include/asm/cacheflush.h
arch/blackfin/include/asm/cacheflush.h
arch/cris/include/asm/cacheflush.h
arch/frv/include/asm/cacheflush.h
arch/h8300/include/asm/cacheflush.h
arch/ia64/include/asm/cacheflush.h
arch/m32r/include/asm/cacheflush.h
arch/m68k/include/asm/cacheflush_mm.h
arch/m68k/include/asm/cacheflush_no.h
arch/microblaze/include/asm/cacheflush.h
arch/mips/include/asm/cacheflush.h
arch/mn10300/include/asm/cacheflush.h
arch/parisc/include/asm/cacheflush.h
arch/powerpc/include/asm/cacheflush.h
arch/s390/include/asm/cacheflush.h
arch/score/include/asm/cacheflush.h
arch/sh/include/asm/cacheflush.h
arch/sparc/include/asm/cacheflush_32.h
arch/sparc/include/asm/cacheflush_64.h
arch/x86/include/asm/cacheflush.h
arch/xtensa/include/asm/cacheflush.h
block/blk-core.c
drivers/mtd/mtd_blkdevs.c
fs/bio.c
include/asm-generic/cacheflush.h
include/linux/bio.h
include/linux/blkdev.h