kernel-ark/kernel/irq
Thomas Gleixner abc7e40c81 genirq: Prevent chip buslock deadlock
If a interrupt chip utilizes chip->buslock then free_irq() can
deadlock in the following way:

CPU0				CPU1
				interrupt(X) (Shared or spurious)
free_irq(X)			interrupt_thread(X)
chip_bus_lock(X)
				   irq_finalize_oneshot(X)
				     chip_bus_lock(X)
synchronize_irq(X)
	
synchronize_irq() waits for the interrupt thread to complete,
i.e. forever.

Solution is simple: Drop chip_bus_lock() before calling
synchronize_irq() as we do with the irq_desc lock. There is nothing to
be protected after the point where irq_desc lock has been released.

This adds chip_bus_lock/unlock() to the remove_irq() code path, but
that's actually correct in the case where remove_irq() is called on
such an interrupt. The current users of remove_irq() are not affected
as none of those interrupts is on a chip which requires buslock.

Reported-by: Fredrik Markström <fredrik.markstrom@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
2015-12-14 09:45:06 +01:00
..
autoprobe.c
chip.c genirq: Add flag to force mask in disable_irq[_nosync]() 2015-10-11 11:33:42 +02:00
cpuhotplug.c genirq: Make the cpuhotplug migration code less noisy 2015-10-22 14:34:57 +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: devres: Fix testing return value of request_any_context_irq() 2015-05-13 10:47:37 +02:00
dummychip.c Merge branch 'linus' into irq/core 2015-06-05 22:25:01 +02:00
generic-chip.c genirq: Add chip_[suspend|resume] PM support to irq_chip 2015-07-27 08:09:38 +02:00
handle.c Merge branch 'linus' into irq/core 2015-10-13 19:00:14 +02:00
internals.h genirq/PM: Restore system wake up from chained interrupts 2015-11-10 09:11:31 -05:00
irqdesc.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
irqdomain.c irqdomain: Introduce irq_domain_create_hierarchy 2015-10-13 19:01:25 +02:00
Kconfig genirq: Introduce generic irq migration for cpu hotunplug 2015-10-01 14:51:15 +02:00
Makefile genirq: Introduce generic irq migration for cpu hotunplug 2015-10-01 14:51:15 +02:00
manage.c genirq: Prevent chip buslock deadlock 2015-12-14 09:45:06 +01:00
migration.c genirq: Remove bogus restriction in irq_move_mask_irq() 2015-06-20 19:05:14 +02:00
msi.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-11-03 14:40:01 -08:00
pm.c Merge branches 'irq-urgent-for-linus' and 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-11-15 09:30:48 -08:00
proc.c genirq/PM: Restore system wake up from chained interrupts 2015-11-10 09:11:31 -05:00
resend.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
settings.h genirq: Add flag to force mask in disable_irq[_nosync]() 2015-10-11 11:33:42 +02:00
spurious.c genirq: Remove the irq argument from note_interrupt() 2015-07-11 23:14:25 +02:00