]> git.baikalelectronics.ru Git - kernel.git/commit
genirq: add threaded interrupt handler support
authorThomas Gleixner <tglx@linutronix.de>
Mon, 23 Mar 2009 17:28:15 +0000 (18:28 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 24 Mar 2009 11:15:23 +0000 (12:15 +0100)
commit68a607cfe977d2fbef022ba1bd554067dc2769f9
tree2a696109273fcc421d774cc8fefa4180331a85ad
parent47a4637c932e5b426a0d9f79c0e752f35f148290
genirq: add threaded interrupt handler support

Add support for threaded interrupt handlers:

A device driver can request that its main interrupt handler runs in a
thread. To achive this the device driver requests the interrupt with
request_threaded_irq() and provides additionally to the handler a
thread function. The handler function is called in hard interrupt
context and needs to check whether the interrupt originated from the
device. If the interrupt originated from the device then the handler
can either return IRQ_HANDLED or IRQ_WAKE_THREAD. IRQ_HANDLED is
returned when no further action is required. IRQ_WAKE_THREAD causes
the genirq code to invoke the threaded (main) handler. When
IRQ_WAKE_THREAD is returned handler must have disabled the interrupt
on the device level. This is mandatory for shared interrupt handlers,
but we need to do it as well for obscure x86 hardware where disabling
an interrupt on the IO_APIC level redirects the interrupt to the
legacy PIC interrupt lines.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
include/linux/hardirq.h
include/linux/interrupt.h
include/linux/irq.h
include/linux/irqreturn.h
include/linux/sched.h
kernel/exit.c
kernel/irq/handle.c
kernel/irq/manage.c