This source file includes following definitions.
- irq_fixup_move_pending
- irq_move_masked_irq
- __irq_move_irq
1
2
3 #include <linux/irq.h>
4 #include <linux/interrupt.h>
5
6 #include "internals.h"
7
8
9
10
11
12
13
14
15
16
17
18 bool irq_fixup_move_pending(struct irq_desc *desc, bool force_clear)
19 {
20 struct irq_data *data = irq_desc_get_irq_data(desc);
21
22 if (!irqd_is_setaffinity_pending(data))
23 return false;
24
25
26
27
28
29 if (cpumask_any_and(desc->pending_mask, cpu_online_mask) >= nr_cpu_ids) {
30 irqd_clr_move_pending(data);
31 return false;
32 }
33 if (force_clear)
34 irqd_clr_move_pending(data);
35 return true;
36 }
37
38 void irq_move_masked_irq(struct irq_data *idata)
39 {
40 struct irq_desc *desc = irq_data_to_desc(idata);
41 struct irq_data *data = &desc->irq_data;
42 struct irq_chip *chip = data->chip;
43
44 if (likely(!irqd_is_setaffinity_pending(data)))
45 return;
46
47 irqd_clr_move_pending(data);
48
49
50
51
52 if (irqd_is_per_cpu(data)) {
53 WARN_ON(1);
54 return;
55 }
56
57 if (unlikely(cpumask_empty(desc->pending_mask)))
58 return;
59
60 if (!chip->irq_set_affinity)
61 return;
62
63 assert_raw_spin_locked(&desc->lock);
64
65
66
67
68
69
70
71
72
73
74
75
76
77 if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids) {
78 int ret;
79
80 ret = irq_do_set_affinity(data, desc->pending_mask, false);
81
82
83
84
85
86 if (ret == -EBUSY) {
87 irqd_set_move_pending(data);
88 return;
89 }
90 }
91 cpumask_clear(desc->pending_mask);
92 }
93
94 void __irq_move_irq(struct irq_data *idata)
95 {
96 bool masked;
97
98
99
100
101
102
103 idata = irq_desc_get_irq_data(irq_data_to_desc(idata));
104
105 if (unlikely(irqd_irq_disabled(idata)))
106 return;
107
108
109
110
111
112
113 masked = irqd_irq_masked(idata);
114 if (!masked)
115 idata->chip->irq_mask(idata);
116 irq_move_masked_irq(idata);
117 if (!masked)
118 idata->chip->irq_unmask(idata);
119 }