diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-02-23 16:40:10 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-03-04 11:37:55 -0500 |
commit | b58d971da3433654787a88c40c6fca00f5bbaa04 (patch) | |
tree | 4c4cb014db37762b43674c2814593860e27d088c /arch/xtensa/kernel | |
parent | 5c331c8626f5d39722d07101c699c8e794f5629d (diff) |
xtensa: 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: Peter Zijlstra <peterz@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: xtensa <linux-xtensa@linux-xtensa.org>
Link: http://lkml.kernel.org/r/20140223212736.664624945@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r-- | arch/xtensa/kernel/irq.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index 482868a2de6e..3eee94f621eb 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c | |||
@@ -155,18 +155,6 @@ void __init init_IRQ(void) | |||
155 | } | 155 | } |
156 | 156 | ||
157 | #ifdef CONFIG_HOTPLUG_CPU | 157 | #ifdef CONFIG_HOTPLUG_CPU |
158 | static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu) | ||
159 | { | ||
160 | struct irq_desc *desc = irq_to_desc(irq); | ||
161 | struct irq_chip *chip = irq_data_get_irq_chip(data); | ||
162 | unsigned long flags; | ||
163 | |||
164 | raw_spin_lock_irqsave(&desc->lock, flags); | ||
165 | if (chip->irq_set_affinity) | ||
166 | chip->irq_set_affinity(data, cpumask_of(cpu), false); | ||
167 | raw_spin_unlock_irqrestore(&desc->lock, flags); | ||
168 | } | ||
169 | |||
170 | /* | 158 | /* |
171 | * The CPU has been marked offline. Migrate IRQs off this CPU. If | 159 | * The CPU has been marked offline. Migrate IRQs off this CPU. If |
172 | * the affinity settings do not allow other CPUs, force them onto any | 160 | * the affinity settings do not allow other CPUs, force them onto any |
@@ -175,10 +163,9 @@ static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu) | |||
175 | void migrate_irqs(void) | 163 | void migrate_irqs(void) |
176 | { | 164 | { |
177 | unsigned int i, cpu = smp_processor_id(); | 165 | unsigned int i, cpu = smp_processor_id(); |
178 | struct irq_desc *desc; | ||
179 | 166 | ||
180 | for_each_irq_desc(i, desc) { | 167 | for_each_active_irq(i) { |
181 | struct irq_data *data = irq_desc_get_irq_data(desc); | 168 | struct irq_data *data = irq_get_irq_data(i); |
182 | unsigned int newcpu; | 169 | unsigned int newcpu; |
183 | 170 | ||
184 | if (irqd_is_per_cpu(data)) | 171 | if (irqd_is_per_cpu(data)) |
@@ -194,11 +181,8 @@ void migrate_irqs(void) | |||
194 | i, cpu); | 181 | i, cpu); |
195 | 182 | ||
196 | cpumask_setall(data->affinity); | 183 | cpumask_setall(data->affinity); |
197 | newcpu = cpumask_any_and(data->affinity, | ||
198 | cpu_online_mask); | ||
199 | } | 184 | } |
200 | 185 | irq_set_affinity(i, data->affinity); | |
201 | route_irq(data, i, newcpu); | ||
202 | } | 186 | } |
203 | } | 187 | } |
204 | #endif /* CONFIG_HOTPLUG_CPU */ | 188 | #endif /* CONFIG_HOTPLUG_CPU */ |