Commit ab70f1d5 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner

sparc: Prepare decoupling of page-fault logic from preempt-count

With the separation of pagefault_{disable,enable}() from the
preempt_count a previously overlooked dependancy became painfully
clear.

kmap_atomic() is per cpu and relies not only on disabling the
pagefault handler, but really needs preemption disabled too.

Make this explicit now - so that we can change pagefault_disable().
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent ce0f1eef
...@@ -34,7 +34,7 @@ void *kmap_atomic(struct page *page, enum km_type type) ...@@ -34,7 +34,7 @@ void *kmap_atomic(struct page *page, enum km_type type)
unsigned long idx; unsigned long 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);
...@@ -73,6 +73,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type) ...@@ -73,6 +73,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;
} }
...@@ -99,6 +100,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type) ...@@ -99,6 +100,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);
......
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