aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/interrupt.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-23 18:52:13 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-25 14:24:21 -0500
commitb5faba21a6805c33b40e258d36f57997ee1de131 (patch)
treec84ef3357ecd6e1b1cfda623136529db0e5fab6f /include/linux/interrupt.h
parent1204e95689f9fbd245a4ce5c1b0cd0a9b77f8d25 (diff)
genirq: Prepare the handling of shared oneshot interrupts
For level type interrupts we need to track how many threads are on flight to avoid useless interrupt storms when not all thread handlers have finished yet. Keep track of the woken threads and only unmask when there are no more threads in flight. Yes, I'm lazy and using a bitfield. But not only because I'm lazy, the main reason is that it's way simpler than using a refcount. A refcount based solution would need to keep track of various things like crashing the irq thread, spurious interrupts coming in, disables/enables, free_irq() and some more. The bitfield keeps the tracking simple and makes things just work. It's also nicely confined to the thread code pathes and does not require additional checks all over the place. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <20110223234956.388095876@linutronix.de>
Diffstat (limited to 'include/linux/interrupt.h')
-rw-r--r--include/linux/interrupt.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 8da6643e39a6..e116fef274cd 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -99,6 +99,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
99 * @thread_fn: interupt handler function for threaded interrupts 99 * @thread_fn: interupt handler function for threaded interrupts
100 * @thread: thread pointer for threaded interrupts 100 * @thread: thread pointer for threaded interrupts
101 * @thread_flags: flags related to @thread 101 * @thread_flags: flags related to @thread
102 * @thread_mask: bitmask for keeping track of @thread activity
102 */ 103 */
103struct irqaction { 104struct irqaction {
104 irq_handler_t handler; 105 irq_handler_t handler;
@@ -109,6 +110,7 @@ struct irqaction {
109 irq_handler_t thread_fn; 110 irq_handler_t thread_fn;
110 struct task_struct *thread; 111 struct task_struct *thread;
111 unsigned long thread_flags; 112 unsigned long thread_flags;
113 unsigned long thread_mask;
112 const char *name; 114 const char *name;
113 struct proc_dir_entry *dir; 115 struct proc_dir_entry *dir;
114} ____cacheline_internodealigned_in_smp; 116} ____cacheline_internodealigned_in_smp;