3 #include <linux/interrupt.h>
7 void irq_move_masked_irq(struct irq_data
*idata
)
9 struct irq_desc
*desc
= irq_data_to_desc(idata
);
10 struct irq_chip
*chip
= idata
->chip
;
12 if (likely(!irqd_is_setaffinity_pending(&desc
->irq_data
)))
16 * Paranoia: cpu-local interrupts shouldn't be calling in here anyway.
18 if (!irqd_can_balance(&desc
->irq_data
)) {
23 irqd_clr_move_pending(&desc
->irq_data
);
25 if (unlikely(cpumask_empty(desc
->pending_mask
)))
28 if (!chip
->irq_set_affinity
)
31 assert_raw_spin_locked(&desc
->lock
);
34 * If there was a valid mask to work with, please
35 * do the disable, re-program, enable sequence.
36 * This is *not* particularly important for level triggered
37 * but in a edge trigger case, we might be setting rte
38 * when an active trigger is comming in. This could
39 * cause some ioapics to mal-function.
40 * Being paranoid i guess!
42 * For correct operation this depends on the caller
45 if (likely(cpumask_any_and(desc
->pending_mask
, cpu_online_mask
)
47 if (!chip
->irq_set_affinity(&desc
->irq_data
,
48 desc
->pending_mask
, false)) {
49 cpumask_copy(desc
->irq_data
.affinity
, desc
->pending_mask
);
50 irq_set_thread_affinity(desc
);
53 cpumask_clear(desc
->pending_mask
);
56 void move_masked_irq(int irq
)
58 irq_move_masked_irq(irq_get_irq_data(irq
));
61 void irq_move_irq(struct irq_data
*idata
)
63 struct irq_desc
*desc
= irq_data_to_desc(idata
);
66 if (likely(!irqd_is_setaffinity_pending(idata
)))
69 if (unlikely(desc
->istate
& IRQS_DISABLED
))
73 * Be careful vs. already masked interrupts. If this is a
74 * threaded interrupt with ONESHOT set, we can end up with an
77 masked
= desc
->istate
& IRQS_MASKED
;
79 idata
->chip
->irq_mask(idata
);
80 irq_move_masked_irq(idata
);
82 idata
->chip
->irq_unmask(idata
);
85 void move_native_irq(int irq
)
87 irq_move_irq(irq_get_irq_data(irq
));