]> git.karo-electronics.de Git - linux-beck.git/commitdiff
genirq: Add preflow handler support
authorThomas Gleixner <tglx@linutronix.de>
Thu, 10 Feb 2011 14:14:20 +0000 (15:14 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 19 Feb 2011 11:58:24 +0000 (12:58 +0100)
sparc64 needs to call a preflow handler on certain interrupts befor
calling the action chain. Integrate it into handle_fasteoi_irq. Must
be enabled via CONFIG_IRQ_FASTEOI_PREFLOW. No impact when disabled.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: David S. Miller <davem@davemloft.net>
include/linux/irq.h
include/linux/irqdesc.h
kernel/irq/Kconfig
kernel/irq/chip.c

index 3e29e2f42e04b65bb6425011373e237b4224d86b..36390970693c193c875a1ad83ab91fc999c1d3e2 100644 (file)
 #include <asm/irq_regs.h>
 
 struct irq_desc;
+struct irq_data;
 typedef        void (*irq_flow_handler_t)(unsigned int irq,
                                            struct irq_desc *desc);
-
+typedef        void (*irq_preflow_handler_t)(struct irq_data *data);
 
 /*
  * IRQ line status.
index 36c95f08023d68b61f936a654e01cc234cfaa68d..2f87d6441302204b0f966e9c61544b38502ded3b 100644 (file)
@@ -63,6 +63,9 @@ struct irq_desc {
        struct timer_rand_state *timer_rand_state;
        unsigned int __percpu   *kstat_irqs;
        irq_flow_handler_t      handle_irq;
+#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
+       irq_preflow_handler_t   preflow_handler;
+#endif
        struct irqaction        *action;        /* IRQ action list */
 #ifdef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
        unsigned int            status_use_accessors;
@@ -187,6 +190,17 @@ static inline void __set_irq_handler_unlocked(int irq,
        desc = irq_to_desc(irq);
        desc->handle_irq = handler;
 }
+
+#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
+static inline void
+__irq_set_preflow_handler(unsigned int irq, irq_preflow_handler_t handler)
+{
+       struct irq_desc *desc;
+
+       desc = irq_to_desc(irq);
+       desc->preflow_handler = handler;
+}
+#endif
 #endif
 
 #endif
index 48ad25f5fa59842c367ab962a041a78b70d9dd0a..9149be729e45a965c0db08e3f26e730fdf680a2c 100644 (file)
@@ -35,6 +35,9 @@ config AUTO_IRQ_AFFINITY
 config HARDIRQS_SW_RESEND
        def_bool n
 
+config IRQ_PREFLOW_FASTEOI
+       def_bool n
+
 config SPARSE_IRQ
        bool "Support sparse irq numbering"
        depends on HAVE_SPARSE_IRQ
index 2a36038b8f59ebc0c570320ed1ee1cf76acc25de..08be5d182be34fb32cdba4d66a6207db101da684 100644 (file)
@@ -471,6 +471,16 @@ out_unlock:
 }
 EXPORT_SYMBOL_GPL(handle_level_irq);
 
+#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
+static inline void preflow_handler(struct irq_desc *desc)
+{
+       if (desc->preflow_handler)
+               desc->preflow_handler(&desc->irq_data);
+}
+#else
+static inline void preflow_handler(struct irq_desc *desc) { }
+#endif
+
 /**
  *     handle_fasteoi_irq - irq handler for transparent controllers
  *     @irq:   the interrupt number
@@ -503,6 +513,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
                mask_irq(desc);
                goto out;
        }
+       preflow_handler(desc);
        handle_irq_event(desc);
 out:
        desc->irq_data.chip->irq_eoi(&desc->irq_data);