summaryrefslogtreecommitdiffstats
path: root/include/linux/interrupt.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-09-21 05:01:10 -0400
committerThomas Gleixner <tglx@linutronix.de>2015-09-22 06:39:57 -0400
commit2a1d3ab8986d1b2f598ffc42351d94166fa0f022 (patch)
tree0511cfc66437216efa8741c4b82c8228cc58e0a1 /include/linux/interrupt.h
parent1f93e4a96c9109378204c147b3eec0d0e8100fde (diff)
genirq: Handle force threading of irqs with primary and thread handler
Force threading of interrupts does not really deal with interrupts which are requested with a primary and a threaded handler. The current policy is to leave them alone and let the primary handler run in interrupt context, but we set the ONESHOT flag for those interrupts as well. Kohji Okuno debugged a problem with the SDHCI driver where the interrupt thread waits for a hardware interrupt to trigger, which can't work well because the hardware interrupt is masked due to the ONESHOT flag being set. He proposed to set the ONESHOT flag only if the interrupt does not provide a thread handler. Though that does not work either because these interrupts can be shared. So the other interrupt would rightfully get the ONESHOT flag set and therefor the same situation would happen again. To deal with this proper, we need to force thread the primary handler of such interrupts as well. That means that the primary interrupt handler is treated as any other primary interrupt handler which is not marked IRQF_NO_THREAD. The threaded handler becomes a separate thread so the SDHCI flow logic can be handled gracefully. The same issue was reported against 4.1-rt. Reported-and-tested-by: Kohji Okuno <okuno.kohji@jp.panasonic.com> Reported-By: Michal Smucr <msmucr@gmail.com> Reported-and-tested-by: Nathan Sullivan <nathan.sullivan@ni.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1509211058080.5606@nanos Signed-off-by: Thomas Gleixner <tglx@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 be7e75c945e9..ad16809c8596 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -102,6 +102,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
102 * @flags: flags (see IRQF_* above) 102 * @flags: flags (see IRQF_* above)
103 * @thread_fn: interrupt handler function for threaded interrupts 103 * @thread_fn: interrupt handler function for threaded interrupts
104 * @thread: thread pointer for threaded interrupts 104 * @thread: thread pointer for threaded interrupts
105 * @secondary: pointer to secondary irqaction (force threading)
105 * @thread_flags: flags related to @thread 106 * @thread_flags: flags related to @thread
106 * @thread_mask: bitmask for keeping track of @thread activity 107 * @thread_mask: bitmask for keeping track of @thread activity
107 * @dir: pointer to the proc/irq/NN/name entry 108 * @dir: pointer to the proc/irq/NN/name entry
@@ -113,6 +114,7 @@ struct irqaction {
113 struct irqaction *next; 114 struct irqaction *next;
114 irq_handler_t thread_fn; 115 irq_handler_t thread_fn;
115 struct task_struct *thread; 116 struct task_struct *thread;
117 struct irqaction *secondary;
116 unsigned int irq; 118 unsigned int irq;
117 unsigned int flags; 119 unsigned int flags;
118 unsigned long thread_flags; 120 unsigned long thread_flags;