aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/irq.h3
-rw-r--r--include/linux/irqdesc.h14
-rw-r--r--kernel/irq/Kconfig3
-rw-r--r--kernel/irq/chip.c11
4 files changed, 30 insertions, 1 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 3e29e2f42e04..36390970693c 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -29,9 +29,10 @@
29#include <asm/irq_regs.h> 29#include <asm/irq_regs.h>
30 30
31struct irq_desc; 31struct irq_desc;
32struct irq_data;
32typedef void (*irq_flow_handler_t)(unsigned int irq, 33typedef void (*irq_flow_handler_t)(unsigned int irq,
33 struct irq_desc *desc); 34 struct irq_desc *desc);
34 35typedef void (*irq_preflow_handler_t)(struct irq_data *data);
35 36
36/* 37/*
37 * IRQ line status. 38 * IRQ line status.
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 36c95f08023d..2f87d6441302 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -63,6 +63,9 @@ struct irq_desc {
63 struct timer_rand_state *timer_rand_state; 63 struct timer_rand_state *timer_rand_state;
64 unsigned int __percpu *kstat_irqs; 64 unsigned int __percpu *kstat_irqs;
65 irq_flow_handler_t handle_irq; 65 irq_flow_handler_t handle_irq;
66#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
67 irq_preflow_handler_t preflow_handler;
68#endif
66 struct irqaction *action; /* IRQ action list */ 69 struct irqaction *action; /* IRQ action list */
67#ifdef CONFIG_GENERIC_HARDIRQS_NO_COMPAT 70#ifdef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
68 unsigned int status_use_accessors; 71 unsigned int status_use_accessors;
@@ -187,6 +190,17 @@ static inline void __set_irq_handler_unlocked(int irq,
187 desc = irq_to_desc(irq); 190 desc = irq_to_desc(irq);
188 desc->handle_irq = handler; 191 desc->handle_irq = handler;
189} 192}
193
194#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
195static inline void
196__irq_set_preflow_handler(unsigned int irq, irq_preflow_handler_t handler)
197{
198 struct irq_desc *desc;
199
200 desc = irq_to_desc(irq);
201 desc->preflow_handler = handler;
202}
203#endif
190#endif 204#endif
191 205
192#endif 206#endif
diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig
index 48ad25f5fa59..9149be729e45 100644
--- a/kernel/irq/Kconfig
+++ b/kernel/irq/Kconfig
@@ -35,6 +35,9 @@ config AUTO_IRQ_AFFINITY
35config HARDIRQS_SW_RESEND 35config HARDIRQS_SW_RESEND
36 def_bool n 36 def_bool n
37 37
38config IRQ_PREFLOW_FASTEOI
39 def_bool n
40
38config SPARSE_IRQ 41config SPARSE_IRQ
39 bool "Support sparse irq numbering" 42 bool "Support sparse irq numbering"
40 depends on HAVE_SPARSE_IRQ 43 depends on HAVE_SPARSE_IRQ
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 2a36038b8f59..08be5d182be3 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -471,6 +471,16 @@ out_unlock:
471} 471}
472EXPORT_SYMBOL_GPL(handle_level_irq); 472EXPORT_SYMBOL_GPL(handle_level_irq);
473 473
474#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
475static inline void preflow_handler(struct irq_desc *desc)
476{
477 if (desc->preflow_handler)
478 desc->preflow_handler(&desc->irq_data);
479}
480#else
481static inline void preflow_handler(struct irq_desc *desc) { }
482#endif
483
474/** 484/**
475 * handle_fasteoi_irq - irq handler for transparent controllers 485 * handle_fasteoi_irq - irq handler for transparent controllers
476 * @irq: the interrupt number 486 * @irq: the interrupt number
@@ -503,6 +513,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
503 mask_irq(desc); 513 mask_irq(desc);
504 goto out; 514 goto out;
505 } 515 }
516 preflow_handler(desc);
506 handle_irq_event(desc); 517 handle_irq_event(desc);
507out: 518out:
508 desc->irq_data.chip->irq_eoi(&desc->irq_data); 519 desc->irq_data.chip->irq_eoi(&desc->irq_data);