diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2017-08-18 04:39:24 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-08-18 04:54:43 -0400 |
commit | 18416e45b76189daf37ba53b2bd0b9ac3749e92e (patch) | |
tree | f504719b246397809ce6f5c8432f0fee65399936 | |
parent | 79a0d4d8f1ae9568a952c8e5928ee81b30c8df11 (diff) |
irqchip/mips-gic: Report that effective affinity is a single target
The MIPS GIC driver only targets a single CPU at a time, even if
the notional affinity is wider. Let's inform the core code
about this.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Wei Xu <xuwei5@hisilicon.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Gregory Clement <gregory.clement@free-electrons.com>
Cc: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Link: http://lkml.kernel.org/r/20170818083925.10108-12-marc.zyngier@arm.com
-rw-r--r-- | drivers/irqchip/Kconfig | 1 | ||||
-rw-r--r-- | drivers/irqchip/irq-mips-gic.c | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index 39bfa5b25b54..bca9a88012f0 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig | |||
@@ -141,6 +141,7 @@ config IRQ_MIPS_CPU | |||
141 | select GENERIC_IRQ_IPI if SYS_SUPPORTS_MULTITHREADING | 141 | select GENERIC_IRQ_IPI if SYS_SUPPORTS_MULTITHREADING |
142 | select IRQ_DOMAIN | 142 | select IRQ_DOMAIN |
143 | select IRQ_DOMAIN_HIERARCHY if GENERIC_IRQ_IPI | 143 | select IRQ_DOMAIN_HIERARCHY if GENERIC_IRQ_IPI |
144 | select GENERIC_IRQ_EFFECTIVE_AFF_MASK | ||
144 | 145 | ||
145 | config CLPS711X_IRQCHIP | 146 | config CLPS711X_IRQCHIP |
146 | bool | 147 | bool |
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index 6ab1d3afec02..6461380ff1a4 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c | |||
@@ -445,24 +445,27 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask, | |||
445 | unsigned int irq = GIC_HWIRQ_TO_SHARED(d->hwirq); | 445 | unsigned int irq = GIC_HWIRQ_TO_SHARED(d->hwirq); |
446 | cpumask_t tmp = CPU_MASK_NONE; | 446 | cpumask_t tmp = CPU_MASK_NONE; |
447 | unsigned long flags; | 447 | unsigned long flags; |
448 | int i; | 448 | int i, cpu; |
449 | 449 | ||
450 | cpumask_and(&tmp, cpumask, cpu_online_mask); | 450 | cpumask_and(&tmp, cpumask, cpu_online_mask); |
451 | if (cpumask_empty(&tmp)) | 451 | if (cpumask_empty(&tmp)) |
452 | return -EINVAL; | 452 | return -EINVAL; |
453 | 453 | ||
454 | cpu = cpumask_first(&tmp); | ||
455 | |||
454 | /* Assumption : cpumask refers to a single CPU */ | 456 | /* Assumption : cpumask refers to a single CPU */ |
455 | spin_lock_irqsave(&gic_lock, flags); | 457 | spin_lock_irqsave(&gic_lock, flags); |
456 | 458 | ||
457 | /* Re-route this IRQ */ | 459 | /* Re-route this IRQ */ |
458 | gic_map_to_vpe(irq, mips_cm_vp_id(cpumask_first(&tmp))); | 460 | gic_map_to_vpe(irq, mips_cm_vp_id(cpu)); |
459 | 461 | ||
460 | /* Update the pcpu_masks */ | 462 | /* Update the pcpu_masks */ |
461 | for (i = 0; i < min(gic_vpes, NR_CPUS); i++) | 463 | for (i = 0; i < min(gic_vpes, NR_CPUS); i++) |
462 | clear_bit(irq, pcpu_masks[i].pcpu_mask); | 464 | clear_bit(irq, pcpu_masks[i].pcpu_mask); |
463 | set_bit(irq, pcpu_masks[cpumask_first(&tmp)].pcpu_mask); | 465 | set_bit(irq, pcpu_masks[cpu].pcpu_mask); |
464 | 466 | ||
465 | cpumask_copy(irq_data_get_affinity_mask(d), cpumask); | 467 | cpumask_copy(irq_data_get_affinity_mask(d), cpumask); |
468 | irq_data_update_effective_affinity(d, cpumask_of(cpu)); | ||
466 | spin_unlock_irqrestore(&gic_lock, flags); | 469 | spin_unlock_irqrestore(&gic_lock, flags); |
467 | 470 | ||
468 | return IRQ_SET_MASK_OK_NOCOPY; | 471 | return IRQ_SET_MASK_OK_NOCOPY; |
@@ -716,6 +719,7 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int virq, | |||
716 | if (err) | 719 | if (err) |
717 | return err; | 720 | return err; |
718 | 721 | ||
722 | irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(virq))); | ||
719 | return gic_shared_irq_domain_map(d, virq, hwirq, 0); | 723 | return gic_shared_irq_domain_map(d, virq, hwirq, 0); |
720 | } | 724 | } |
721 | 725 | ||