Commit 6408db29 authored by Thomas Gleixner's avatar Thomas Gleixner

mips: Prepare decoupling page-fault logic from preempt-count

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 9cc0ea6b
...@@ -69,7 +69,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, ...@@ -69,7 +69,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
* If we're in an interrupt or have no user * If we're in an interrupt or have no user
* context, we must not take the fault.. * context, we must not take the fault..
*/ */
if (in_atomic() || !mm) if (in_atomic() || !mm || current->pagefault_disabled)
goto bad_area_nosemaphore; goto bad_area_nosemaphore;
down_read(&mm->mmap_sem); down_read(&mm->mmap_sem);
......
...@@ -45,7 +45,7 @@ void *__kmap_atomic(struct page *page, enum km_type type) ...@@ -45,7 +45,7 @@ void *__kmap_atomic(struct page *page, enum km_type type)
enum fixed_addresses idx; enum fixed_addresses idx;
unsigned long vaddr; unsigned long vaddr;
/* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ preempt_disable();
pagefault_disable(); pagefault_disable();
if (!PageHighMem(page)) if (!PageHighMem(page))
return page_address(page); return page_address(page);
...@@ -71,6 +71,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type) ...@@ -71,6 +71,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
if (vaddr < FIXADDR_START) { // FIXME if (vaddr < FIXADDR_START) { // FIXME
pagefault_enable(); pagefault_enable();
preempt_enable();
return; return;
} }
...@@ -85,6 +86,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type) ...@@ -85,6 +86,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
#endif #endif
pagefault_enable(); pagefault_enable();
preempt_enable();
} }
EXPORT_SYMBOL(__kunmap_atomic); EXPORT_SYMBOL(__kunmap_atomic);
...@@ -97,6 +99,7 @@ void *kmap_atomic_pfn(unsigned long pfn, enum km_type type) ...@@ -97,6 +99,7 @@ void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
enum fixed_addresses idx; enum fixed_addresses idx;
unsigned long vaddr; unsigned long vaddr;
preempt_disable();
pagefault_disable(); pagefault_disable();
debug_kmap_atomic(type); debug_kmap_atomic(type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment