summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorMaJun <majun258@huawei.com>2017-05-18 16:19:13 +0800
committerMarc Zyngier <marc.zyngier@arm.com>2017-06-22 14:13:27 +0100
commit8b8d94a72fd4e773320173efbc745ed8fe677ac5 (patch)
tree583c74fa8023210400310493855d934cff1a2bcb /drivers/irqchip
parent3403b0259d152c3ca67b32bb710f826bc17c0d16 (diff)
downloadlinux-8b8d94a72fd4e773320173efbc745ed8fe677ac5.tar.bz2
irqchip/gicv3-its: Skip irq affinity setting when target cpu is the same as current setting
Just skip the irq affinity setting when the target cpu is the same as current setting. This is a small optimization for irq affinity setting logic. Signed-off-by: MaJun <majun258@huawei.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-gic-v3-its.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 45ea193325d2..b33528026c5c 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -644,9 +644,12 @@ static int its_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
if (cpu >= nr_cpu_ids)
return -EINVAL;
- target_col = &its_dev->its->collections[cpu];
- its_send_movi(its_dev, target_col, id);
- its_dev->event_map.col_map[id] = cpu;
+ /* don't set the affinity when the target cpu is same as current one */
+ if (cpu != its_dev->event_map.col_map[id]) {
+ target_col = &its_dev->its->collections[cpu];
+ its_send_movi(its_dev, target_col, id);
+ its_dev->event_map.col_map[id] = cpu;
+ }
return IRQ_SET_MASK_OK_DONE;
}