aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index bb32326afe87..a1b903380bcf 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -139,6 +139,25 @@ static inline void
139irq_get_pending(struct cpumask *mask, struct irq_desc *desc) { } 139irq_get_pending(struct cpumask *mask, struct irq_desc *desc) { }
140#endif 140#endif
141 141
142int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
143 bool force)
144{
145 struct irq_desc *desc = irq_data_to_desc(data);
146 struct irq_chip *chip = irq_data_get_irq_chip(data);
147 int ret;
148
149 ret = chip->irq_set_affinity(data, mask, false);
150 switch (ret) {
151 case IRQ_SET_MASK_OK:
152 cpumask_copy(data->affinity, mask);
153 case IRQ_SET_MASK_OK_NOCOPY:
154 irq_set_thread_affinity(desc);
155 ret = 0;
156 }
157
158 return ret;
159}
160
142int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask) 161int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask)
143{ 162{
144 struct irq_chip *chip = irq_data_get_irq_chip(data); 163 struct irq_chip *chip = irq_data_get_irq_chip(data);
@@ -149,14 +168,7 @@ int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask)
149 return -EINVAL; 168 return -EINVAL;
150 169
151 if (irq_can_move_pcntxt(data)) { 170 if (irq_can_move_pcntxt(data)) {
152 ret = chip->irq_set_affinity(data, mask, false); 171 ret = irq_do_set_affinity(data, mask, false);
153 switch (ret) {
154 case IRQ_SET_MASK_OK:
155 cpumask_copy(data->affinity, mask);
156 case IRQ_SET_MASK_OK_NOCOPY:
157 irq_set_thread_affinity(desc);
158 ret = 0;
159 }
160 } else { 172 } else {
161 irqd_set_move_pending(data); 173 irqd_set_move_pending(data);
162 irq_copy_pending(desc, mask); 174 irq_copy_pending(desc, mask);
@@ -280,9 +292,8 @@ EXPORT_SYMBOL_GPL(irq_set_affinity_notifier);
280static int 292static int
281setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask) 293setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask)
282{ 294{
283 struct irq_chip *chip = irq_desc_get_chip(desc);
284 struct cpumask *set = irq_default_affinity; 295 struct cpumask *set = irq_default_affinity;
285 int ret, node = desc->irq_data.node; 296 int node = desc->irq_data.node;
286 297
287 /* Excludes PER_CPU and NO_BALANCE interrupts */ 298 /* Excludes PER_CPU and NO_BALANCE interrupts */
288 if (!irq_can_set_affinity(irq)) 299 if (!irq_can_set_affinity(irq))
@@ -308,13 +319,7 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask)
308 if (cpumask_intersects(mask, nodemask)) 319 if (cpumask_intersects(mask, nodemask))
309 cpumask_and(mask, mask, nodemask); 320 cpumask_and(mask, mask, nodemask);
310 } 321 }
311 ret = chip->irq_set_affinity(&desc->irq_data, mask, false); 322 irq_do_set_affinity(&desc->irq_data, mask, false);
312 switch (ret) {
313 case IRQ_SET_MASK_OK:
314 cpumask_copy(desc->irq_data.affinity, mask);
315 case IRQ_SET_MASK_OK_NOCOPY:
316 irq_set_thread_affinity(desc);
317 }
318 return 0; 323 return 0;
319} 324}
320#else 325#else