kernel-fxtec-pro1x/kernel/irq
Thomas Gleixner a899418167 hotplug: Prevent alloc/free of irq descriptors during cpu up/down
When a cpu goes up some architectures (e.g. x86) have to walk the irq
space to set up the vector space for the cpu. While this needs extra
protection at the architecture level we can avoid a few race
conditions by preventing the concurrent allocation/free of irq
descriptors and the associated data.

When a cpu goes down it moves the interrupts which are targeted to
this cpu away by reassigning the affinities. While this happens
interrupts can be allocated and freed, which opens a can of race
conditions in the code which reassignes the affinities because
interrupt descriptors might be freed underneath.

Example:

CPU1				CPU2
cpu_up/down
 irq_desc = irq_to_desc(irq);
				remove_from_radix_tree(desc);
 raw_spin_lock(&desc->lock);
				free(desc);

We could protect the irq descriptors with RCU, but that would require
a full tree change of all accesses to interrupt descriptors. But
fortunately these kind of race conditions are rather limited to a few
things like cpu hotplug. The normal setup/teardown is very well
serialized. So the simpler and obvious solution is:

Prevent allocation and freeing of interrupt descriptors accross cpu
hotplug.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: xiao jin <jin.xiao@intel.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Yanmin Zhang <yanmin_zhang@linux.intel.com>
Link: http://lkml.kernel.org/r/20150705171102.063519515@linutronix.de
2015-07-08 11:32:25 +02:00
..
autoprobe.c
chip.c irq: Add irq_set_chained_handler_and_data() 2015-06-18 14:03:08 +02:00
debug.h
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: generic chip: Support hierarchy domain 2015-05-18 17:32:44 +02:00
handle.c
internals.h hotplug: Prevent alloc/free of irq descriptors during cpu up/down 2015-07-08 11:32:25 +02:00
irqdesc.c Merge branch 'irq/for-x86' into irq/core 2015-06-20 19:14:31 +02:00
irqdomain.c Merge branch 'irq/for-x86' into irq/core 2015-06-20 19:14:31 +02:00
Kconfig
Makefile
manage.c genirq: Introduce helper function irq_data_get_node() 2015-06-12 16:54:21 +02:00
migration.c genirq: Remove bogus restriction in irq_move_mask_irq() 2015-06-20 19:05:14 +02:00
msi.c genirq: MSI: Constify irq_domain_ops 2015-05-05 10:45:58 +02:00
pm.c genirq: Don't suspend nested_thread irqs over system suspend 2015-05-18 17:23:47 +02:00
proc.c genirq: Introduce helper function irq_data_get_node() 2015-06-12 16:54:21 +02:00
resend.c
settings.h
spurious.c