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 <bernds_cb1@t-online.de>
Signed-off-by: Bryan Wu <cooloney@kernel.org>

authored by Bernd Schmidt and committed by Bryan Wu 3d9b7a5c 225f7e1e

+4 -2
+4 -2
include/asm-blackfin/mmu_context.h
··· 173 173 174 174 static inline void update_protections(struct mm_struct *mm) 175 175 { 176 - flush_switched_cplbs(); 177 - set_mask_dcplbs(mm->context.page_rwx_mask); 176 + if (mm->context.page_rwx_mask == current_rwx_mask) { 177 + flush_switched_cplbs(); 178 + set_mask_dcplbs(mm->context.page_rwx_mask); 179 + } 178 180 } 179 181 #endif 180 182