@@ -492,7 +492,7 @@ static int xive_pick_irq_target(struct irq_data *d,
/*
* If we have chip IDs, first we try to build a mask of
- * CPUs matching ther CPU and find a target in there
+ * CPUs matching the CPU and find a target in there
*/
if (xd->src_chip != XIVE_INVALID_CHIP_ID &&
zalloc_cpumask_var(&mask, GFP_ATOMIC)) {
@@ -503,7 +503,9 @@ static int xive_pick_irq_target(struct irq_data *d,
cpumask_set_cpu(cpu, mask);
}
/* Try to find a target */
- if (!cpumask_empty(mask))
+ if (cpumask_empty(mask))
+ cpu = -1;
+ else
cpu = xive_find_target_in_mask(mask, fuzz++);
free_cpumask_var(mask);
if (cpu >= 0)
xive_pick_irq_target() first tries to construct a mask that is the intersection of the requested affinity, online CPUs, and the group of CPUs that are on the same chip as the interrupt source. If that resulting mask is empty, we were incorrectly returning nr_cpu_ids as a target. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> --- arch/powerpc/sysdev/xive/common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)