Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / drivers / irqchip / irq-csky-mpintc.c
index 806ba0e..a1534ed 100644 (file)
@@ -139,8 +139,19 @@ static int csky_irq_set_affinity(struct irq_data *d,
        if (cpu >= nr_cpu_ids)
                return -EINVAL;
 
-       /* Enable interrupt destination */
-       cpu |= BIT(31);
+       /*
+        * The csky,mpintc could support auto irq deliver, but it only
+        * could deliver external irq to one cpu or all cpus. So it
+        * doesn't support deliver external irq to a group of cpus
+        * with cpu_mask.
+        * SO we only use auto deliver mode when affinity mask_val is
+        * equal to cpu_present_mask.
+        *
+        */
+       if (cpumask_equal(mask_val, cpu_present_mask))
+               cpu = 0;
+       else
+               cpu |= BIT(31);
 
        writel_relaxed(cpu, INTCG_base + INTCG_CIDSTR + offset);