Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[sfrench/cifs-2.6.git] / arch / arm / kernel / traps.c
index a964c9f40f875882e3bf4d722eb7290074981709..0c8b10801d36ad6a25806892ea283c7b93d28f61 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/irq.h>
 
 #include <linux/atomic.h>
 #include <asm/cacheflush.h>
@@ -460,10 +461,29 @@ die_sig:
        arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6);
 }
 
-asmlinkage void do_unexp_fiq (struct pt_regs *regs)
+/*
+ * Handle FIQ similarly to NMI on x86 systems.
+ *
+ * The runtime environment for NMIs is extremely restrictive
+ * (NMIs can pre-empt critical sections meaning almost all locking is
+ * forbidden) meaning this default FIQ handling must only be used in
+ * circumstances where non-maskability improves robustness, such as
+ * watchdog or debug logic.
+ *
+ * This handler is not appropriate for general purpose use in drivers
+ * platform code and can be overrideen using set_fiq_handler.
+ */
+asmlinkage void __exception_irq_entry handle_fiq_as_nmi(struct pt_regs *regs)
 {
-       printk("Hmm.  Unexpected FIQ received, but trying to continue\n");
-       printk("You may have a hardware problem...\n");
+       struct pt_regs *old_regs = set_irq_regs(regs);
+
+       nmi_enter();
+
+       /* nop. FIQ handlers for special arch/arm features can be added here. */
+
+       nmi_exit();
+
+       set_irq_regs(old_regs);
 }
 
 /*