| From: David Hildenbrand <dahi@linux.vnet.ibm.com> |
| Date: Mon, 11 May 2015 17:52:10 +0200 |
| Subject: sched/preempt, mm/kmap, MIPS: Disable preemption in kmap_coherent() explicitly |
| |
| k(un)map_coherent relies on pagefault_disable() to also disable |
| preemption. |
| |
| Let's make this explicit, to prepare for pagefault_disable() not |
| touching preemption anymore. |
| |
| This patch is based on a patch by Yang Shi on the -rt tree: |
| "k{un}map_coherent are just called when cpu_has_dc_aliases == 1 with VIPT |
| cache. However, actually, the most modern MIPS processors have PIPT dcache |
| without dcache alias issue. In such case, k{un}map_atomic will be called |
| with preempt enabled." |
| |
| [upstream commit ce01948eb85da733558fa77c2a554144a57ab0fb] |
| Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> |
| --- |
| arch/mips/mm/init.c | 2 ++ |
| 1 file changed, 2 insertions(+) |
| |
| --- a/arch/mips/mm/init.c |
| +++ b/arch/mips/mm/init.c |
| @@ -90,6 +90,7 @@ static void *__kmap_pgprot(struct page * |
| |
| BUG_ON(Page_dcache_dirty(page)); |
| |
| + preempt_disable(); |
| pagefault_disable(); |
| idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1); |
| idx += in_interrupt() ? FIX_N_COLOURS : 0; |
| @@ -152,6 +153,7 @@ void kunmap_coherent(void) |
| write_c0_entryhi(old_ctx); |
| local_irq_restore(flags); |
| pagefault_enable(); |
| + preempt_enable(); |
| } |
| |
| void copy_user_highpage(struct page *to, struct page *from, |