kernel-ark/kernel/irq
Thomas Gleixner 18258f7239 genirq: Provide synchronize_hardirq()
synchronize_irq() waits for hard irq and threaded handlers to complete
before returning. For some special cases we only need to make sure
that the hard interrupt part of the irq line is not in progress when
we disabled the - possibly shared - interrupt at the device level.

A proper use case for this was provided by Russell. The sdhci driver
requires some irq triggered functions to be run in thread context. The
current implementation of the thread context is a sdio private kthread
construct, which has quite some shortcomings. These can be avoided
when the thread is directly associated to the device interrupt via the
generic threaded irq infrastructure.

Though there is a corner case related to run time power management
where one side disables the device interrupts at the device level and
needs to make sure, that an already running hard interrupt handler has
completed before proceeding further. Though that hard interrupt
handler might wake the associated thread, which in turn can request
the runtime PM to reenable the device. Using synchronize_irq() leads
to an immediate deadlock of the irq thread waiting for the PM lock and
the synchronize_irq() waiting for the irq thread to complete.

Due to the fact that it is sufficient for this case to ensure that no
hard irq handler is executing a new function which avoids the check
for the thread is required.

Add a function, which just monitors the hard irq parts and ignores the
threaded handlers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Russell King <linux@arm.linux.org.uk>
Cc: Chris Ball <chris@printf.net>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20140215003823.653236081@linutronix.de
2014-02-19 17:22:44 +01:00
..
autoprobe.c genirq: Handle pending irqs in irq_startup() 2012-02-15 11:56:59 +01:00
chip.c irq: Fix some trivial typos in comments 2013-10-18 14:49:30 +02:00
debug.h irq: hide debug macros so they don't collide with others. 2012-04-23 12:30:03 -04:00
devres.c genirq: Add devm_request_any_context_irq() 2014-02-09 15:27:21 +01:00
dummychip.c genirq: Export dummy_irq_chip 2012-08-21 16:14:23 +02:00
generic-chip.c Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-07-13 15:37:30 -07:00
handle.c random: make 'add_interrupt_randomness()' do something sane 2012-07-14 20:17:28 -04:00
internals.h genirq: Introduce irq_do_set_affinity() to reduce duplicated code 2012-05-24 22:36:40 +02:00
irqdesc.c genirq: Add missing irq_to_desc export for CONFIG_SPARSE_IRQ=n 2014-02-11 10:30:36 +01:00
irqdomain.c of/irq: simplify args to irq_create_of_mapping 2013-10-24 11:42:57 +01:00
Kconfig genirq: Generic irq chip requires IRQ_DOMAIN 2014-02-05 10:17:32 +01:00
Makefile irq: add irq_domain translation infrastructure 2011-07-28 01:32:04 -06:00
manage.c genirq: Provide synchronize_hardirq() 2014-02-19 17:22:44 +01:00
migration.c genirq: Introduce irq_do_set_affinity() to reduce duplicated code 2012-05-24 22:36:40 +02:00
pm.c irq: Enable all irqs unconditionally in irq_resume 2013-11-25 22:20:02 +01:00
proc.c irqdomain: Include hwirq number in /proc/interrupts 2013-06-24 14:02:42 +01:00
resend.c genirq: Provide means to retrigger parent 2012-11-01 12:11:31 +01:00
settings.h genirq: Prevent spurious detection for unconditionally polled interrupts 2013-11-13 16:03:02 +01:00
spurious.c genirq: Prevent spurious detection for unconditionally polled interrupts 2013-11-13 16:03:02 +01:00