diff options
author | Jiang Liu <liuj97@gmail.com> | 2012-03-30 11:11:33 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2012-03-30 17:13:46 -0400 |
commit | f5cb92ac82d06cb583c1f66666314c5c0a4d7913 (patch) | |
tree | 3553fcffceda28462137f73f3f81ccccc19c620b /kernel/irq | |
parent | 241fc640be783f903e74b6d9c68481c01873f758 (diff) |
genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value
irq_move_masked_irq() checks the return code of
chip->irq_set_affinity() only for 0, but IRQ_SET_MASK_OK_NOCOPY is
also a valid return code, which is there to avoid a redundant copy of
the cpumask. But in case of IRQ_SET_MASK_OK_NOCOPY we not only avoid
the redundant copy, we also fail to adjust the thread affinity of an
eventually threaded interrupt handler.
Handle IRQ_SET_MASK_OK (==0) and IRQ_SET_MASK_OK_NOCOPY(==1) return
values correctly by checking the valid return values seperately.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Jiang Liu <liuj97@gmail.com>
Cc: Keping Chen <chenkeping@huawei.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1333120296-13563-2-git-send-email-jiang.liu@huawei.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/migration.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c index 47420908fba0..c3c89751b327 100644 --- a/kernel/irq/migration.c +++ b/kernel/irq/migration.c | |||
@@ -43,12 +43,16 @@ void irq_move_masked_irq(struct irq_data *idata) | |||
43 | * masking the irqs. | 43 | * masking the irqs. |
44 | */ | 44 | */ |
45 | if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask) | 45 | if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask) |
46 | < nr_cpu_ids)) | 46 | < nr_cpu_ids)) { |
47 | if (!chip->irq_set_affinity(&desc->irq_data, | 47 | int ret = chip->irq_set_affinity(&desc->irq_data, |
48 | desc->pending_mask, false)) { | 48 | desc->pending_mask, false); |
49 | switch (ret) { | ||
50 | case IRQ_SET_MASK_OK: | ||
49 | cpumask_copy(desc->irq_data.affinity, desc->pending_mask); | 51 | cpumask_copy(desc->irq_data.affinity, desc->pending_mask); |
52 | case IRQ_SET_MASK_OK_NOCOPY: | ||
50 | irq_set_thread_affinity(desc); | 53 | irq_set_thread_affinity(desc); |
51 | } | 54 | } |
55 | } | ||
52 | 56 | ||
53 | cpumask_clear(desc->pending_mask); | 57 | cpumask_clear(desc->pending_mask); |
54 | } | 58 | } |