summaryrefslogtreecommitdiffstats
path: root/include/linux/hardirq.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-02-15 00:55:18 +0000
committerThomas Gleixner <tglx@linutronix.de>2014-02-19 17:22:44 +0100
commit18258f7239a61d8929b8e0c7b6d46c446459074c (patch)
treedce8fcb83bdf02120fa6ae419262936aa33b49ca /include/linux/hardirq.h
parent6d0abeca3242a88cab8232e4acd7e2bf088f3bc2 (diff)
downloadblackbird-op-linux-18258f7239a61d8929b8e0c7b6d46c446459074c.tar.gz
blackbird-op-linux-18258f7239a61d8929b8e0c7b6d46c446459074c.zip
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
Diffstat (limited to 'include/linux/hardirq.h')
-rw-r--r--include/linux/hardirq.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 12d5f972f23f..cba442ec3c66 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -9,6 +9,7 @@
extern void synchronize_irq(unsigned int irq);
+extern void synchronize_hardirq(unsigned int irq);
#if defined(CONFIG_TINY_RCU)
OpenPOWER on IntegriCloud