kernel_optimize_test/kernel/irq
Yinghai Lu 57b150cce8 irq: only update affinity if ->set_affinity() is sucessfull
irq_set_affinity() and move_masked_irq() try to assign affinity
before calling chip set_affinity(). Some archs are assigning it
in ->set_affinity() again.

We do something like:

 cpumask_cpy(desc->affinity, mask);
 desc->chip->set_affinity(mask);

But in the failure path, affinity should not be touched - otherwise
we'll end up with a different affinity mask despite the failure to
migrate the IRQ.

So try to update the afffinity only if set_affinity returns with 0.
Also call irq_set_thread_affinity accordingly.

v2: update after "irq, x86: Remove IRQ_DISABLED check in process context IRQ move"
v3: according to Ingo, change set_affinity() in irq_chip should return int.
v4: update comments by removing moving irq_desc code.

[ Impact: fix /proc/irq/*/smp_affinity setting corner case bug ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
LKML-Reference: <49F65509.60307@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-28 12:21:16 +02:00
..
autoprobe.c async: Asynchronous function calls to speed up kernel boot 2009-01-07 08:45:46 -08:00
chip.c x86/irq: remove leftover code from NUMA_MIGRATE_IRQ_DESC 2009-04-28 12:21:15 +02:00
devres.c genirq: add support for threaded interrupts to devres 2009-03-24 12:15:23 +01:00
handle.c x86/irq: remove leftover code from NUMA_MIGRATE_IRQ_DESC 2009-04-28 12:21:15 +02:00
internals.h irq: only update affinity if ->set_affinity() is sucessfull 2009-04-28 12:21:16 +02:00
Makefile x86/irq: remove leftover code from NUMA_MIGRATE_IRQ_DESC 2009-04-28 12:21:15 +02:00
manage.c irq: only update affinity if ->set_affinity() is sucessfull 2009-04-28 12:21:16 +02:00
migration.c irq: only update affinity if ->set_affinity() is sucessfull 2009-04-28 12:21:16 +02:00
numa_migrate.c x86/irq: remove leftover code from NUMA_MIGRATE_IRQ_DESC 2009-04-28 12:21:15 +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