aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-03-24 06:46:22 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-03-24 07:15:23 -0400
commitf48fe81e5b032914183e9a17052313720c2cac56 (patch)
tree9404047368387a6f8b39b4a822ef28e18eba45e9 /kernel/irq/manage.c
parent935bd5b971f0df7c06d214d022cf8392e2f37952 (diff)
genirq: threaded irq handlers review fixups
Delta patch to address the review comments. - Implement warning when IRQ_WAKE_THREAD is requested and no thread handler installed - coding style fixes Pointed-out-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index a4c1ab86cd25..a3eb7baf1e46 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -407,20 +407,17 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
407 return ret; 407 return ret;
408} 408}
409 409
410static inline int irq_thread_should_run(struct irqaction *action)
411{
412 return test_and_clear_bit(IRQTF_RUNTHREAD, &action->thread_flags);
413}
414
415static int irq_wait_for_interrupt(struct irqaction *action) 410static int irq_wait_for_interrupt(struct irqaction *action)
416{ 411{
417 while (!kthread_should_stop()) { 412 while (!kthread_should_stop()) {
418 set_current_state(TASK_INTERRUPTIBLE); 413 set_current_state(TASK_INTERRUPTIBLE);
419 if (irq_thread_should_run(action)) { 414
415 if (test_and_clear_bit(IRQTF_RUNTHREAD,
416 &action->thread_flags)) {
420 __set_current_state(TASK_RUNNING); 417 __set_current_state(TASK_RUNNING);
421 return 0; 418 return 0;
422 } else 419 }
423 schedule(); 420 schedule();
424 } 421 }
425 return -1; 422 return -1;
426} 423}
@@ -820,8 +817,8 @@ EXPORT_SYMBOL(free_irq);
820 * @irq: Interrupt line to allocate 817 * @irq: Interrupt line to allocate
821 * @handler: Function to be called when the IRQ occurs. 818 * @handler: Function to be called when the IRQ occurs.
822 * Primary handler for threaded interrupts 819 * Primary handler for threaded interrupts
823 * @thread_fn: Function called from the irq handler thread 820 * @thread_fn: Function called from the irq handler thread
824 * If NULL, no irq thread is created 821 * If NULL, no irq thread is created
825 * @irqflags: Interrupt type flags 822 * @irqflags: Interrupt type flags
826 * @devname: An ascii name for the claiming device 823 * @devname: An ascii name for the claiming device
827 * @dev_id: A cookie passed back to the handler function 824 * @dev_id: A cookie passed back to the handler function