linux-stable/kernel/irq
Thomas Gleixner 399b5da29b genirq: Support nested threaded irq handling
Interrupt chips which are behind a slow bus (i2c, spi ...) and
demultiplex other interrupt sources need to run their interrupt
handler in a thread. 

The demultiplexed interrupt handlers need to run in thread context as
well and need to finish before the demux handler thread can reenable
the interrupt line. So the easiest way is to run the sub device
handlers in the context of the demultiplexing handler thread.

To avoid that a separate thread is created for the subdevices the
function set_nested_irq_thread() is provided which sets the
IRQ_NESTED_THREAD flag in the interrupt descriptor.

A driver which calls request_threaded_irq() must not be aware of the
fact that the threaded handler is called in the context of the
demultiplexing handler thread. The setup code checks the
IRQ_NESTED_THREAD flag which was set from the irq chip setup code and
does not setup a separate thread for the interrupt. The primary
function which is provided by the device driver is replaced by an
internal dummy function which warns when it is called.

For the demultiplexing handler a helper function handle_nested_irq()
is provided which calls the demux interrupt thread function in the
context of the caller and does the proper interrupt accounting and
takes the interrupt disabled status of the demultiplexed subdevice
into account.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Trilok Soni <soni.trilok@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Brian Swetland <swetland@google.com>
Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: m.szyprowski@samsung.com
Cc: t.fujak@samsung.com
Cc: kyungmin.park@samsung.com,
Cc: David Brownell <david-b@pacbell.net>
Cc: Daniel Ribeiro <drwyrm@gmail.com>
Cc: arve@android.com
Cc: Barry Song <21cnbao@gmail.com>
2009-08-17 10:54:05 +02:00
..
autoprobe.c async: Asynchronous function calls to speed up kernel boot 2009-01-07 08:45:46 -08:00
chip.c genirq: Support nested threaded irq handling 2009-08-17 10:54:05 +02:00
devres.c genirq: add support for threaded interrupts to devres 2009-03-24 12:15:23 +01:00
handle.c irq: slab alloc for default irq_affinity 2009-06-12 13:50:23 +03:00
internals.h genirq: Add buslock support 2009-08-17 10:54:05 +02:00
Makefile x86/irq: use move_irq_desc() in create_irq_nr() 2009-05-01 19:01:12 +02:00
manage.c genirq: Support nested threaded irq handling 2009-08-17 10:54:05 +02:00
migration.c genirq: Delegate irq affinity setting to the irq thread 2009-07-21 14:35:07 +02:00
numa_migrate.c x86/irq: Fix move_irq_desc() for nodes without ram 2009-08-08 17:06:03 +02:00
pm.c PM: Introduce functions for suspending and resuming device interrupts 2009-03-30 21:46:54 +02:00
proc.c cpumask: update irq_desc to use cpumask_var_t 2009-01-11 19:12:46 +01:00
resend.c generic: sparse irqs: use irq_desc() together with dyn_array, instead of irq_desc[] 2008-10-16 16:52:29 +02:00
spurious.c irq: provide debug_poll_all_shared_irqs() method under CONFIG_DEBUG_SHIRQ 2009-01-16 17:46:49 +01:00