From: Paul Mundt Date: Tue, 4 Aug 2009 06:57:44 +0000 (+0900) Subject: sh: Add a PG_dcache_dirty sanity check in kmap_coherent(). X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=700487c158163f14e6ff10de770b565c1c993c69;p=linux-beck.git 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 --- 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) 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;