From 20c01f806686dfbff0710817ca46d022ddff8eb2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 24 Jul 2009 15:23:27 +0200 Subject: [PATCH] mips: Prepare decoupling page-fault logic from preempt-count commit 6408db29f29fe5a2f6d385a9957b113ac766a921 in tip. Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- arch/mips/mm/fault.c | 2 +- arch/mips/mm/highmem.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index b78f7d9..1c762e4 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -75,7 +75,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, * If we're in an interrupt or have no user * context, we must not take the fault.. */ - if (in_atomic() || !mm) + if (in_atomic() || !mm || current->pagefault_disabled) goto bad_area_nosemaphore; down_read(&mm->mmap_sem); diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c index 127d732..384159b 100644 --- a/arch/mips/mm/highmem.c +++ b/arch/mips/mm/highmem.c @@ -46,7 +46,7 @@ void *__kmap_atomic(struct page *page, enum km_type type) enum fixed_addresses idx; unsigned long vaddr; - /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ + preempt_disable(); pagefault_disable(); if (!PageHighMem(page)) return page_address(page); @@ -72,6 +72,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type) if (vaddr < FIXADDR_START) { // FIXME pagefault_enable(); + preempt_enable(); return; } @@ -86,6 +87,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type) #endif pagefault_enable(); + preempt_enable(); } EXPORT_SYMBOL(__kunmap_atomic); @@ -98,6 +100,7 @@ void *kmap_atomic_pfn(unsigned long pfn, enum km_type type) enum fixed_addresses idx; unsigned long vaddr; + preempt_disable(); pagefault_disable(); debug_kmap_atomic(type); -- 1.7.0.4