Skip to content

Commit

Permalink
sh: Add a PG_dcache_dirty sanity check in kmap_coherent().
Browse files Browse the repository at this point in the history
This plugs in a BUG_ON() in kmap_coherent() for PG_dcache_dirty pages
to catch when things go horribly wrong. Copied from the MIPS
implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Aug 4, 2009
1 parent 3ed6e12 commit 700487c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/sh/mm/pg-mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ static inline void *kmap_coherent(struct page *page, unsigned long addr)
unsigned long vaddr, flags;
pte_t pte;

BUG_ON(test_bit(PG_dcache_dirty, &page->flags));

inc_preempt_count();

idx = (addr & current_cpu_data.dcache.alias_mask) >> PAGE_SHIFT;
Expand Down

0 comments on commit 700487c

Please sign in to comment.