Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / kernel / irq / irqdesc.c
index 9149dde..9484e88 100644 (file)
@@ -680,6 +680,8 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq,
  * @hwirq:     The HW irq number to convert to a logical one
  * @regs:      Register file coming from the low-level handling code
  *
+ *             This function must be called from an NMI context.
+ *
  * Returns:    0 on success, or -EINVAL if conversion has failed
  */
 int handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq,
@@ -689,7 +691,10 @@ int handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq,
        unsigned int irq;
        int ret = 0;
 
-       nmi_enter();
+       /*
+        * NMI context needs to be setup earlier in order to deal with tracing.
+        */
+       WARN_ON(!in_nmi());
 
        irq = irq_find_mapping(domain, hwirq);
 
@@ -702,7 +707,6 @@ int handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq,
        else
                ret = -EINVAL;
 
-       nmi_exit();
        set_irq_regs(old_regs);
        return ret;
 }