u32 val, mask, bit;
unsigned long flags;
- if (!force)
- cpu = cpumask_any_and(mask_val, cpu_online_mask);
- else
- cpu = cpumask_first(mask_val);
+ gic_lock_irqsave(flags);
+ if (unlikely(d->common->state_use_accessors & IRQD_GIC_MULTI_TARGET)) {
+ struct cpumask temp_mask;
- if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
- return -EINVAL;
+ bit = 0;
+ if (!cpumask_and(&temp_mask, mask_val, cpu_online_mask))
+ goto err_out;
- gic_lock_irqsave(flags);
+ for_each_cpu(cpu, &temp_mask) {
+ if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
+ goto err_out;
+ bit |= gic_cpu_map[cpu];
+ }
+ bit <<= shift;
+ } else {
+ if (!force)
+ cpu = cpumask_any_and(mask_val, cpu_online_mask);
+ else
+ cpu = cpumask_first(mask_val);
+
+ if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
+ goto err_out;
+
+ bit = gic_cpu_map[cpu] << shift;
+ }
mask = 0xff << shift;
- bit = gic_cpu_map[cpu] << shift;
val = readl_relaxed(reg) & ~mask;
writel_relaxed(val | bit, reg);
gic_unlock_irqrestore(flags);
irq_data_update_effective_affinity(d, cpumask_of(cpu));
return IRQ_SET_MASK_OK_DONE;
+err_out:
+ gic_unlock_irqrestore(flags);
+ return -EINVAL;
}
#endif