Skip to content

Commit

Permalink
irqchip/gic-v3: Honor forced affinity setting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Suzuki K Poulose authored and Marc Zyngier committed Jul 4, 2017
1 parent 63c16c6 commit 65a30f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/irqchip/irq-gic-v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 65a30f8

Please sign in to comment.