Blame view
kernel/irq/migration.c
1.48 KB
c777ac559
|
1 |
|
d824e66a9
|
2 |
#include <linux/irq.h> |
57b150cce
|
3 4 5 |
#include <linux/interrupt.h> #include "internals.h" |
c777ac559
|
6 |
|
e7b946e98
|
7 |
void move_masked_irq(int irq) |
c777ac559
|
8 |
{ |
08678b084
|
9 |
struct irq_desc *desc = irq_to_desc(irq); |
c777ac559
|
10 |
|
a24ceab4f
|
11 |
if (likely(!(desc->status & IRQ_MOVE_PENDING))) |
c777ac559
|
12 |
return; |
501f2499b
|
13 14 15 16 17 18 19 |
/* * Paranoia: cpu-local interrupts shouldn't be calling in here anyway. */ if (CHECK_IRQ_PER_CPU(desc->status)) { WARN_ON(1); return; } |
a24ceab4f
|
20 |
desc->status &= ~IRQ_MOVE_PENDING; |
c777ac559
|
21 |
|
7f7ace0cd
|
22 |
if (unlikely(cpumask_empty(desc->pending_mask))) |
c777ac559
|
23 |
return; |
d1bef4ed5
|
24 |
if (!desc->chip->set_affinity) |
c777ac559
|
25 |
return; |
239007b84
|
26 |
assert_raw_spin_locked(&desc->lock); |
501f2499b
|
27 |
|
c777ac559
|
28 29 30 31 32 33 34 35 |
/* * If there was a valid mask to work with, please * do the disable, re-program, enable sequence. * This is *not* particularly important for level triggered * but in a edge trigger case, we might be setting rte * when an active trigger is comming in. This could * cause some ioapics to mal-function. * Being paranoid i guess! |
e7b946e98
|
36 37 38 |
* * For correct operation this depends on the caller * masking the irqs. |
c777ac559
|
39 |
*/ |
7f7ace0cd
|
40 |
if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask) |
57b150cce
|
41 42 43 |
< nr_cpu_ids)) if (!desc->chip->set_affinity(irq, desc->pending_mask)) { cpumask_copy(desc->affinity, desc->pending_mask); |
591d2fb02
|
44 |
irq_set_thread_affinity(desc); |
57b150cce
|
45 |
} |
7f7ace0cd
|
46 |
cpumask_clear(desc->pending_mask); |
c777ac559
|
47 |
} |
e7b946e98
|
48 49 50 |
void move_native_irq(int irq) { |
08678b084
|
51 |
struct irq_desc *desc = irq_to_desc(irq); |
e7b946e98
|
52 53 54 |
if (likely(!(desc->status & IRQ_MOVE_PENDING))) return; |
2a786b452
|
55 56 |
if (unlikely(desc->status & IRQ_DISABLED)) return; |
e7b946e98
|
57 |
|
2a786b452
|
58 |
desc->chip->mask(irq); |
e7b946e98
|
59 |
move_masked_irq(irq); |
2a786b452
|
60 |
desc->chip->unmask(irq); |
e7b946e98
|
61 |
} |