]> Git Repo - linux.git/commitdiff
irqchip/gic-v3-its: Don't bind LPI to unavailable NUMA node
authorYang Yingliang <[email protected]>
Fri, 22 Jun 2018 09:52:51 +0000 (10:52 +0100)
committerThomas Gleixner <[email protected]>
Fri, 22 Jun 2018 12:22:01 +0000 (14:22 +0200)
On a NUMA system, if an ITS is local to an offline node, the ITS driver may
pick an offline CPU to bind the LPI.  In this case, pick an online CPU (and
the first one will do).

But on some systems, binding an LPI to non-local node CPU may cause
deadlock (see Cavium erratum 23144).  In this case, just fail the activate
and return an error code.

Signed-off-by: Yang Yingliang <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Sumit Garg <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
drivers/irqchip/irq-gic-v3-its.c

index 5377d7e2afba62b518671267b5d29c4963c2e5e6..cae53937feebd2f80b588c75a6e89d631206a4a0 100644 (file)
@@ -2310,7 +2310,14 @@ static int its_irq_domain_activate(struct irq_domain *domain,
                cpu_mask = cpumask_of_node(its_dev->its->numa_node);
 
        /* Bind the LPI to the first possible CPU */
-       cpu = cpumask_first(cpu_mask);
+       cpu = cpumask_first_and(cpu_mask, cpu_online_mask);
+       if (cpu >= nr_cpu_ids) {
+               if (its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144)
+                       return -EINVAL;
+
+               cpu = cpumask_first(cpu_online_mask);
+       }
+
        its_dev->event_map.col_map[event] = cpu;
        irq_data_update_effective_affinity(d, cpumask_of(cpu));
 
This page took 0.052415 seconds and 4 git commands to generate.