Skip to content

Commit

Permalink
sh: Ensure all PG_dcache_dirty pages are written back.
Browse files Browse the repository at this point in the history
With some of the cache rework an address aliasing optimization was added,
but this managed to fail on certain mappings resulting in pages with
PG_dcache_dirty set never writing back their dcache lines. This patch
reverts to the earlier behaviour of simply always writing back when the
dirty bit is set.

Signed-off-by: Markus Pietrek <Markus.Pietrek@emtrion.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Markus Pietrek authored and Paul Mundt committed Dec 24, 2009
1 parent 9503e89 commit 76382b5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arch/sh/mm/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,8 @@ void __update_cache(struct vm_area_struct *vma,
page = pfn_to_page(pfn);
if (pfn_valid(pfn)) {
int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
if (dirty) {
unsigned long addr = (unsigned long)page_address(page);

if (pages_do_alias(addr, address & PAGE_MASK))
__flush_purge_region((void *)addr, PAGE_SIZE);
}
if (dirty)
__flush_purge_region(page_address(page), PAGE_SIZE);
}
}

Expand Down

0 comments on commit 76382b5

Please sign in to comment.