mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Peter Horton <[email protected]> Cc: "Ed L. Cashin" <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
3586e917f2
commit
2d4dc890b5
29 changed files with 83 additions and 0 deletions
|
|
@ -59,12 +59,14 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr,
|
|||
for (; nsect > 0; nsect--, block++, buf += tr->blksize)
|
||||
if (tr->readsect(dev, block, buf))
|
||||
return -EIO;
|
||||
rq_flush_dcache_pages(req);
|
||||
return 0;
|
||||
|
||||
case WRITE:
|
||||
if (!tr->writesect)
|
||||
return -EIO;
|
||||
|
||||
rq_flush_dcache_pages(req);
|
||||
for (; nsect > 0; nsect--, block++, buf += tr->blksize)
|
||||
if (tr->writesect(dev, block, buf))
|
||||
return -EIO;
|
||||
|
|
|
|||
Loading…
Reference in a new issue