aboutsummaryrefslogtreecommitdiffstats
path: root/arch/metag
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-02-23 16:40:11 -0500
committerJames Hogan <james.hogan@imgtec.com>2014-03-17 08:34:59 -0400
commit48ce8e3f7080869763cfb3ab4ac57bb0ba4da698 (patch)
tree54a19c522339436338765d29c60347e4cf54b4fc /arch/metag
parentdcb99fd9b08cfe1afe426af4d8d3cbc429190f15 (diff)
metag: Use irq_set_affinity instead of homebrewn code
There is no point in having an incomplete copy of irq_set_affinity() for the hotplug irq migration code. Use the core function instead and while at it switch to for_each_active_irq() Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: James Hogan <james.hogan@imgtec.com> Cc: metag <linux-metag@vger.kernel.org> Signed-off-by: James Hogan <james.hogan@imgtec.com>
Diffstat (limited to 'arch/metag')
-rw-r--r--arch/metag/kernel/irq.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/arch/metag/kernel/irq.c b/arch/metag/kernel/irq.c
index 3b4b7f6c0950..5385dd1216b7 100644
--- a/arch/metag/kernel/irq.c
+++ b/arch/metag/kernel/irq.c
@@ -261,18 +261,6 @@ int __init arch_probe_nr_irqs(void)
261} 261}
262 262
263#ifdef CONFIG_HOTPLUG_CPU 263#ifdef CONFIG_HOTPLUG_CPU
264static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu)
265{
266 struct irq_desc *desc = irq_to_desc(irq);
267 struct irq_chip *chip = irq_data_get_irq_chip(data);
268 unsigned long flags;
269
270 raw_spin_lock_irqsave(&desc->lock, flags);
271 if (chip->irq_set_affinity)
272 chip->irq_set_affinity(data, cpumask_of(cpu), false);
273 raw_spin_unlock_irqrestore(&desc->lock, flags);
274}
275
276/* 264/*
277 * The CPU has been marked offline. Migrate IRQs off this CPU. If 265 * The CPU has been marked offline. Migrate IRQs off this CPU. If
278 * the affinity settings do not allow other CPUs, force them onto any 266 * the affinity settings do not allow other CPUs, force them onto any
@@ -281,10 +269,9 @@ static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu)
281void migrate_irqs(void) 269void migrate_irqs(void)
282{ 270{
283 unsigned int i, cpu = smp_processor_id(); 271 unsigned int i, cpu = smp_processor_id();
284 struct irq_desc *desc;
285 272
286 for_each_irq_desc(i, desc) { 273 for_each_active_irq(i) {
287 struct irq_data *data = irq_desc_get_irq_data(desc); 274 struct irq_data *data = irq_get_irq_data(i);
288 unsigned int newcpu; 275 unsigned int newcpu;
289 276
290 if (irqd_is_per_cpu(data)) 277 if (irqd_is_per_cpu(data))
@@ -300,11 +287,8 @@ void migrate_irqs(void)
300 i, cpu); 287 i, cpu);
301 288
302 cpumask_setall(data->affinity); 289 cpumask_setall(data->affinity);
303 newcpu = cpumask_any_and(data->affinity,
304 cpu_online_mask);
305 } 290 }
306 291 irq_set_affinity(i, data->affinity);
307 route_irq(data, i, newcpu);
308 } 292 }
309} 293}
310#endif /* CONFIG_HOTPLUG_CPU */ 294#endif /* CONFIG_HOTPLUG_CPU */