Skip to content

Commit f5cb92a

Browse files
jiangliuKAGA-KOKO
authored andcommitted
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>
1 parent 241fc64 commit f5cb92a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

kernel/irq/migration.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ void irq_move_masked_irq(struct irq_data *idata)
4343
* masking the irqs.
4444
*/
4545
if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask)
46-
< nr_cpu_ids))
47-
if (!chip->irq_set_affinity(&desc->irq_data,
48-
desc->pending_mask, false)) {
46+
< nr_cpu_ids)) {
47+
int ret = chip->irq_set_affinity(&desc->irq_data,
48+
desc->pending_mask, false);
49+
switch (ret) {
50+
case IRQ_SET_MASK_OK:
4951
cpumask_copy(desc->irq_data.affinity, desc->pending_mask);
52+
case IRQ_SET_MASK_OK_NOCOPY:
5053
irq_set_thread_affinity(desc);
5154
}
55+
}
5256

5357
cpumask_clear(desc->pending_mask);
5458
}

0 commit comments

Comments
 (0)