diff options
author | Guo Ren <ren_guo@c-sky.com> | 2019-05-21 03:54:05 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2019-06-05 04:27:07 -0400 |
commit | db56c5128e6625cb16efc4910b60627e46f608e3 (patch) | |
tree | 2505df2796799502826fc952c2ca113e71dbe99b | |
parent | 16e32c3cde7763ab875b9030b443ecbc8e352d8a (diff) |
irqchip/irq-csky-mpintc: Support auto irq deliver to all cpus
The csky,mpintc could deliver a external irq to one cpu or all cpus, but
it couldn't deliver a 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.
There is no limitation for only two cpus in SMP system.
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | drivers/irqchip/irq-csky-mpintc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-csky-mpintc.c b/drivers/irqchip/irq-csky-mpintc.c index c67c961ab6cc..a4c1aacba1ff 100644 --- a/drivers/irqchip/irq-csky-mpintc.c +++ b/drivers/irqchip/irq-csky-mpintc.c | |||
@@ -89,8 +89,19 @@ static int csky_irq_set_affinity(struct irq_data *d, | |||
89 | if (cpu >= nr_cpu_ids) | 89 | if (cpu >= nr_cpu_ids) |
90 | return -EINVAL; | 90 | return -EINVAL; |
91 | 91 | ||
92 | /* Enable interrupt destination */ | 92 | /* |
93 | cpu |= BIT(31); | 93 | * The csky,mpintc could support auto irq deliver, but it only |
94 | * could deliver external irq to one cpu or all cpus. So it | ||
95 | * doesn't support deliver external irq to a group of cpus | ||
96 | * with cpu_mask. | ||
97 | * SO we only use auto deliver mode when affinity mask_val is | ||
98 | * equal to cpu_present_mask. | ||
99 | * | ||
100 | */ | ||
101 | if (cpumask_equal(mask_val, cpu_present_mask)) | ||
102 | cpu = 0; | ||
103 | else | ||
104 | cpu |= BIT(31); | ||
94 | 105 | ||
95 | writel_relaxed(cpu, INTCG_base + INTCG_CIDSTR + offset); | 106 | writel_relaxed(cpu, INTCG_base + INTCG_CIDSTR + offset); |
96 | 107 | ||