Skip to content

Commit

Permalink
sh: force dcache flush if dcache_dirty bit set.
Browse files Browse the repository at this point in the history
This too follows the ARM change, given that the issue at hand applies to
all platforms that implement lazy D-cache writeback.

This fixes up the case when a page mapping disappears between the
flush_dcache_page() call (when PG_dcache_dirty is set for the page) and
the update_mmu_cache() call -- such as in the case of swap cache being
freed early. This kills off the mapping test in update_mmu_cache() and
switches to simply testing for PG_dcache_dirty.

Reported-by: Nitin Gupta <ngupta@vflare.org>
Reported-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Oct 13, 2009
1 parent af67c3a commit 964f7e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sh/mm/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void __update_cache(struct vm_area_struct *vma,
return;

page = pfn_to_page(pfn);
if (pfn_valid(pfn) && page_mapping(page)) {
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);
Expand Down

0 comments on commit 964f7e5

Please sign in to comment.