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
= desc
->irq_data
.chip
;
12 if (likely(!irqd_is_setaffinity_pending(&desc
->irq_data
)))
15 irqd_clr_move_pending(&desc
->irq_data
);
18 * Paranoia: cpu-local interrupts shouldn't be calling in here anyway.
20 if (irqd_is_per_cpu(&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 coming 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 (cpumask_any_and(desc
->pending_mask
, cpu_online_mask
) < nr_cpu_ids
)
46 irq_do_set_affinity(&desc
->irq_data
, desc
->pending_mask
, false);
48 cpumask_clear(desc
->pending_mask
);
51 void irq_move_irq(struct irq_data
*idata
)
56 * Get top level irq_data when CONFIG_IRQ_DOMAIN_HIERARCHY is enabled,
57 * and it should be optimized away when CONFIG_IRQ_DOMAIN_HIERARCHY is
58 * disabled. So we avoid an "#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY" here.
60 idata
= irq_desc_get_irq_data(irq_data_to_desc(idata
));
62 if (likely(!irqd_is_setaffinity_pending(idata
)))
65 if (unlikely(irqd_irq_disabled(idata
)))
69 * Be careful vs. already masked interrupts. If this is a
70 * threaded interrupt with ONESHOT set, we can end up with an
73 masked
= irqd_irq_masked(idata
);
75 idata
->chip
->irq_mask(idata
);
76 irq_move_masked_irq(idata
);
78 idata
->chip
->irq_unmask(idata
);