diff options
Diffstat (limited to 'drivers/irqchip/irq-gic.c')
-rw-r--r-- | drivers/irqchip/irq-gic.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 4300b6606f5e..57d165e026f4 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -246,10 +246,14 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, | |||
246 | bool force) | 246 | bool force) |
247 | { | 247 | { |
248 | void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3); | 248 | void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3); |
249 | unsigned int shift = (gic_irq(d) % 4) * 8; | 249 | unsigned int cpu, shift = (gic_irq(d) % 4) * 8; |
250 | unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); | ||
251 | u32 val, mask, bit; | 250 | u32 val, mask, bit; |
252 | 251 | ||
252 | if (!force) | ||
253 | cpu = cpumask_any_and(mask_val, cpu_online_mask); | ||
254 | else | ||
255 | cpu = cpumask_first(mask_val); | ||
256 | |||
253 | if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids) | 257 | if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids) |
254 | return -EINVAL; | 258 | return -EINVAL; |
255 | 259 | ||