From: Bernd Schmidt Date: Mon, 25 Aug 2008 10:41:15 +0000 (+0800) Subject: Blackfin arch: fix bug - MPU crashes under stress X-Git-Tag: v2.6.27-rc5~2^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3d9b7a5ce534f3963afcf8f4777267e5899fe007;p=linux-2.6-omap-h63xx.git Blackfin arch: fix bug - MPU crashes under stress Bug Description: a customer reported under IRQ stress, running applications may wrongly trigger an ICPLB miss and be killed. after playing a bit more, here's a test case that may be triggering the same bug. Fixing: After modifying page protections, only modify the active CPLBs if the protection change was made for the active mm. Signed-off-by: Bernd Schmidt Signed-off-by: Bryan Wu --- diff --git a/include/asm-blackfin/mmu_context.h b/include/asm-blackfin/mmu_context.h index f55ec3c23a9..8529552a981 100644 --- a/include/asm-blackfin/mmu_context.h +++ b/include/asm-blackfin/mmu_context.h @@ -173,8 +173,10 @@ static inline void protect_page(struct mm_struct *mm, unsigned long addr, static inline void update_protections(struct mm_struct *mm) { - flush_switched_cplbs(); - set_mask_dcplbs(mm->context.page_rwx_mask); + if (mm->context.page_rwx_mask == current_rwx_mask) { + flush_switched_cplbs(); + set_mask_dcplbs(mm->context.page_rwx_mask); + } } #endif