aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/migration.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/irq/migration.c')
-rw-r--r--kernel/irq/migration.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
index 6bdd03c524c7..52a8655fa080 100644
--- a/kernel/irq/migration.c
+++ b/kernel/irq/migration.c
@@ -18,9 +18,17 @@ void move_native_irq(int irq)
18 cpumask_t tmp; 18 cpumask_t tmp;
19 irq_desc_t *desc = irq_descp(irq); 19 irq_desc_t *desc = irq_descp(irq);
20 20
21 if (likely (!desc->move_irq)) 21 if (likely(!desc->move_irq))
22 return; 22 return;
23 23
24 /*
25 * Paranoia: cpu-local interrupts shouldn't be calling in here anyway.
26 */
27 if (CHECK_IRQ_PER_CPU(desc->status)) {
28 WARN_ON(1);
29 return;
30 }
31
24 desc->move_irq = 0; 32 desc->move_irq = 0;
25 33
26 if (likely(cpus_empty(pending_irq_cpumask[irq]))) 34 if (likely(cpus_empty(pending_irq_cpumask[irq])))
@@ -29,7 +37,8 @@ void move_native_irq(int irq)
29 if (!desc->handler->set_affinity) 37 if (!desc->handler->set_affinity)
30 return; 38 return;
31 39
32 /* note - we hold the desc->lock */ 40 assert_spin_locked(&desc->lock);
41
33 cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map); 42 cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
34 43
35 /* 44 /*
@@ -42,9 +51,13 @@ void move_native_irq(int irq)
42 * Being paranoid i guess! 51 * Being paranoid i guess!
43 */ 52 */
44 if (unlikely(!cpus_empty(tmp))) { 53 if (unlikely(!cpus_empty(tmp))) {
45 desc->handler->disable(irq); 54 if (likely(!(desc->status & IRQ_DISABLED)))
55 desc->handler->disable(irq);
56
46 desc->handler->set_affinity(irq,tmp); 57 desc->handler->set_affinity(irq,tmp);
47 desc->handler->enable(irq); 58
59 if (likely(!(desc->status & IRQ_DISABLED)))
60 desc->handler->enable(irq);
48 } 61 }
49 cpus_clear(pending_irq_cpumask[irq]); 62 cpus_clear(pending_irq_cpumask[irq]);
50} 63}