]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arch/tile: don't enable irqs unconditionally in page fault handler
authorChris Metcalf <cmetcalf@tilera.com>
Thu, 29 Mar 2012 19:40:50 +0000 (15:40 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Fri, 30 Mar 2012 22:56:10 +0000 (18:56 -0400)
If we took a page fault while we had interrupts disabled, we
shouldn't enable them in the page fault handler.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
arch/tile/mm/fault.c

index bcba1592ee21bf7820417f659d23e75db80e70b3..5d10a749bba74359437aa068cf2c1c326673d03f 100644 (file)
@@ -343,9 +343,12 @@ static int handle_page_fault(struct pt_regs *regs,
        /*
         * If we're trying to touch user-space addresses, we must
         * be either at PL0, or else with interrupts enabled in the
-        * kernel, so either way we can re-enable interrupts here.
+        * kernel, so either way we can re-enable interrupts here
+        * unless we are doing atomic access to user space with
+        * interrupts disabled.
         */
-       local_irq_enable();
+       if (!(regs->flags & PT_FLAGS_DISABLE_IRQ))
+               local_irq_enable();
 
        mm = tsk->mm;