Merge branch 'genirq' of master.kernel.org:/home/rmk/linux-2.6-arm
[firefly-linux-kernel-4.4.55.git] / kernel / irq / handle.c
index 6070e046469018521279fb93c4466cffaa88790e..6d8b30114961a46669455b7e5721319751e94744 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
 
+#if defined(CONFIG_NO_IDLE_HZ) && defined(CONFIG_ARM)
+#include <asm/dyntick.h>
+#endif
+
 #include "internals.h"
 
 /**
@@ -91,6 +95,22 @@ struct irq_chip no_irq_chip = {
        .end            = noop,
 };
 
+/*
+ * Generic dummy implementation which can be used for
+ * real dumb interrupt sources
+ */
+struct irq_chip dummy_irq_chip = {
+       .name           = "dummy",
+       .startup        = noop_ret,
+       .shutdown       = noop,
+       .enable         = noop,
+       .disable        = noop,
+       .ack            = noop,
+       .mask           = noop,
+       .unmask         = noop,
+       .end            = noop,
+};
+
 /*
  * Special, empty irq handler:
  */
@@ -113,6 +133,15 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
        irqreturn_t ret, retval = IRQ_NONE;
        unsigned int status = 0;
 
+#if defined(CONFIG_NO_IDLE_HZ) && defined(CONFIG_ARM)
+       if (!(action->flags & SA_TIMER) && system_timer->dyn_tick != NULL) {
+               write_seqlock(&xtime_lock);
+               if (system_timer->dyn_tick->state & DYN_TICK_ENABLED)
+                       system_timer->dyn_tick->handler(irq, 0, regs);
+               write_sequnlock(&xtime_lock);
+       }
+#endif
+
        if (!(action->flags & IRQF_DISABLED))
                local_irq_enable();