diff options
author | Suzuki K Poulose <suzuki.poulose@arm.com> | 2017-07-04 11:56:35 +0200 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2017-07-04 12:11:26 +0200 |
commit | 65a30f8b300107266f316d550f060ccc186201a3 (patch) | |
tree | b5b80632e39c846d5bc8796e393c3beb53177bdc /drivers/irqchip | |
parent | irqchip/gic-v3: Report failures in gic_irq_domain_alloc (diff) | |
download | linux-65a30f8b300107266f316d550f060ccc186201a3.tar.xz linux-65a30f8b300107266f316d550f060ccc186201a3.zip |
irqchip/gic-v3: Honor forced affinity setting
Honor the 'force' flag for set_affinity, by selecting a CPU
from the given mask (which may not be reported "online" by
the cpu_online_mask). Some drivers, like ARM PMU, rely on it.
Cc: Marc Zyngier <marc.zyngier@arm.com>
Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r-- | drivers/irqchip/irq-gic-v3.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 47630e9998b3..5ba64a7584a3 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -640,11 +640,16 @@ static void gic_smp_init(void) static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, bool force) { - unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); + unsigned int cpu; void __iomem *reg; int enabled; u64 val; + if (force) + cpu = cpumask_first(mask_val); + else + cpu = cpumask_any_and(mask_val, cpu_online_mask); + if (cpu >= nr_cpu_ids) return -EINVAL; |