diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-04-06 17:01:44 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-04-23 09:56:24 -0400 |
commit | 7f1b1244e159a8490d7fb13667c6cb7e1e75046b (patch) | |
tree | 1d5f5ff0ec14e3ac84d4ec17b0de4d43dacf8118 /include | |
parent | 770767787c23040dc152e7ae230597ff55b39470 (diff) |
genirq: Support per-IRQ thread disabling.
This adds support for disabling threading on a per-IRQ basis via the IRQ
status instead of the IRQ flow, which is necessary for interrupts that
don't follow the natural IRQ flow channels, such as those that are
virtually created.
The new APIs added are simply:
irq_set_thread()
irq_set_nothread()
which follow the rest of the IRQ status routines.
Chained handlers also have IRQ_NOTHREAD set on them automatically, making
the lack of threading explicit rather than implicit. Subsequently, the
nothread flag can be viewed through the standard genirq debugging
facilities.
[ tglx: Fixed cleanup fallout ]
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Link: http://lkml.kernel.org/r/%3C20110406210135.GF18426%40linux-sh.org%3E
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/irq.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index a71dd18639fb..39c23786c1db 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -59,6 +59,7 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data); | |||
59 | * IRQ_NOPROBE - Interrupt cannot be probed by autoprobing | 59 | * IRQ_NOPROBE - Interrupt cannot be probed by autoprobing |
60 | * IRQ_NOREQUEST - Interrupt cannot be requested via | 60 | * IRQ_NOREQUEST - Interrupt cannot be requested via |
61 | * request_irq() | 61 | * request_irq() |
62 | * IRQ_NOTHREAD - Interrupt cannot be threaded | ||
62 | * IRQ_NOAUTOEN - Interrupt is not automatically enabled in | 63 | * IRQ_NOAUTOEN - Interrupt is not automatically enabled in |
63 | * request/setup_irq() | 64 | * request/setup_irq() |
64 | * IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set) | 65 | * IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set) |
@@ -85,6 +86,7 @@ enum { | |||
85 | IRQ_NO_BALANCING = (1 << 13), | 86 | IRQ_NO_BALANCING = (1 << 13), |
86 | IRQ_MOVE_PCNTXT = (1 << 14), | 87 | IRQ_MOVE_PCNTXT = (1 << 14), |
87 | IRQ_NESTED_THREAD = (1 << 15), | 88 | IRQ_NESTED_THREAD = (1 << 15), |
89 | IRQ_NOTHREAD = (1 << 16), | ||
88 | }; | 90 | }; |
89 | 91 | ||
90 | #define IRQF_MODIFY_MASK \ | 92 | #define IRQF_MODIFY_MASK \ |
@@ -422,7 +424,7 @@ irq_set_handler(unsigned int irq, irq_flow_handler_t handle) | |||
422 | /* | 424 | /* |
423 | * Set a highlevel chained flow handler for a given IRQ. | 425 | * Set a highlevel chained flow handler for a given IRQ. |
424 | * (a chained handler is automatically enabled and set to | 426 | * (a chained handler is automatically enabled and set to |
425 | * IRQ_NOREQUEST and IRQ_NOPROBE) | 427 | * IRQ_NOREQUEST, IRQ_NOPROBE, and IRQ_NOTHREAD) |
426 | */ | 428 | */ |
427 | static inline void | 429 | static inline void |
428 | irq_set_chained_handler(unsigned int irq, irq_flow_handler_t handle) | 430 | irq_set_chained_handler(unsigned int irq, irq_flow_handler_t handle) |
@@ -452,6 +454,16 @@ static inline void irq_set_probe(unsigned int irq) | |||
452 | irq_modify_status(irq, IRQ_NOPROBE, 0); | 454 | irq_modify_status(irq, IRQ_NOPROBE, 0); |
453 | } | 455 | } |
454 | 456 | ||
457 | static inline void irq_set_nothread(unsigned int irq) | ||
458 | { | ||
459 | irq_modify_status(irq, 0, IRQ_NOTHREAD); | ||
460 | } | ||
461 | |||
462 | static inline void irq_set_thread(unsigned int irq) | ||
463 | { | ||
464 | irq_modify_status(irq, IRQ_NOTHREAD, 0); | ||
465 | } | ||
466 | |||
455 | static inline void irq_set_nested_thread(unsigned int irq, bool nest) | 467 | static inline void irq_set_nested_thread(unsigned int irq, bool nest) |
456 | { | 468 | { |
457 | if (nest) | 469 | if (nest) |