ARM: fault: assume no context when IRQs are disabled during data abort.
authorJP Abgrall <jpa@google.com>
Mon, 29 Apr 2013 23:07:00 +0000 (16:07 -0700)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 21:16:25 +0000 (14:16 -0700)
Bail out early if IRQs are disabled in do_page_fault or else
  [14415.157266] BUG: sleeping function called from invalid context at arch/arm/mm/fault.c:301

Russell King's idea from
  http://comments.gmane.org/gmane.linux.ports.arm.omap/59256

Signed-off-by: JP Abgrall <jpa@google.com>
arch/arm/mm/fault.c

index 5dbf13f954f6f493aaae525d4f3b93282ac88f75..b835c9e3b770b7bbe7684ec7282ece27700e6655 100644 (file)
@@ -276,10 +276,10 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
                local_irq_enable();
 
        /*
-        * If we're in an interrupt or have no user
+        * If we're in an interrupt, or have no irqs, or have no user
         * context, we must not take the fault..
         */
-       if (in_atomic() || !mm)
+       if (in_atomic() || irqs_disabled() || !mm)
                goto no_context;
 
        /*