diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-08-04 02:57:44 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-04 02:57:44 -0400 |
commit | 700487c158163f14e6ff10de770b565c1c993c69 (patch) | |
tree | fb86dee477c2903e975527461070638b03f85970 | |
parent | 3ed6e129390fb872c3b7e05a232e5d380fbdfb48 (diff) |
sh: Add a PG_dcache_dirty sanity check in kmap_coherent().
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>
-rw-r--r-- | arch/sh/mm/pg-mmu.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/sh/mm/pg-mmu.c b/arch/sh/mm/pg-mmu.c index 8602f68af4c8..32351206edd3 100644 --- a/arch/sh/mm/pg-mmu.c +++ b/arch/sh/mm/pg-mmu.c | |||
@@ -37,6 +37,8 @@ static inline void *kmap_coherent(struct page *page, unsigned long addr) | |||
37 | unsigned long vaddr, flags; | 37 | unsigned long vaddr, flags; |
38 | pte_t pte; | 38 | pte_t pte; |
39 | 39 | ||
40 | BUG_ON(test_bit(PG_dcache_dirty, &page->flags)); | ||
41 | |||
40 | inc_preempt_count(); | 42 | inc_preempt_count(); |
41 | 43 | ||
42 | idx = (addr & current_cpu_data.dcache.alias_mask) >> PAGE_SHIFT; | 44 | idx = (addr & current_cpu_data.dcache.alias_mask) >> PAGE_SHIFT; |