Skip to content

Commit

Permalink
genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return v…
Browse files Browse the repository at this point in the history
…alue

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 <[email protected]>
Cc: Jiang Liu <[email protected]>
Cc: Keping Chen <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
jiangliu authored and KAGA-KOKO committed Mar 30, 2012
1 parent 241fc64 commit f5cb92a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kernel/irq/migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ void irq_move_masked_irq(struct irq_data *idata)
* masking the irqs.
*/
if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask)
< nr_cpu_ids))
if (!chip->irq_set_affinity(&desc->irq_data,
desc->pending_mask, false)) {
< nr_cpu_ids)) {
int ret = chip->irq_set_affinity(&desc->irq_data,
desc->pending_mask, false);
switch (ret) {
case IRQ_SET_MASK_OK:
cpumask_copy(desc->irq_data.affinity, desc->pending_mask);
case IRQ_SET_MASK_OK_NOCOPY:
irq_set_thread_affinity(desc);
}
}

cpumask_clear(desc->pending_mask);
}
Expand Down

0 comments on commit f5cb92a

Please sign in to comment.