42 lines
1.4 KiB
Diff
42 lines
1.4 KiB
Diff
From 91021aa7ea1469d0b3127e68d177e0ad58a7eda3 Mon Sep 17 00:00:00 2001
|
|
From: David Hildenbrand <dahi@linux.vnet.ibm.com>
|
|
Date: Mon, 11 May 2015 17:52:10 +0200
|
|
Subject: [PATCH 05/14] mips: kmap_coherent relies on disabled preemption
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.0/patches-4.0.5-rt3.tar.xz
|
|
|
|
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."
|
|
|
|
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;
|
|
@@ -147,6 +148,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,
|