aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2018-06-22 05:52:51 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-06-22 08:22:01 -0400
commitc1797b11a09c8323c92b074fd48b89a936c991d0 (patch)
treef4ed347b92bdaf64eecf8c7fb7c8d061cb002205
parentcbaf45a6be497c272e80500e4fd9bccdf20d5050 (diff)
irqchip/gic-v3-its: Don't bind LPI to unavailable NUMA node
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 <yangyingliang@huawei.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Sumit Garg <sumit.garg@linaro.org> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180622095254.5906-5-marc.zyngier@arm.com
-rw-r--r--drivers/irqchip/irq-gic-v3-its.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 5377d7e2afba..cae53937feeb 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -2310,7 +2310,14 @@ static int its_irq_domain_activate(struct irq_domain *domain,
2310 cpu_mask = cpumask_of_node(its_dev->its->numa_node); 2310 cpu_mask = cpumask_of_node(its_dev->its->numa_node);
2311 2311
2312 /* Bind the LPI to the first possible CPU */ 2312 /* Bind the LPI to the first possible CPU */
2313 cpu = cpumask_first(cpu_mask); 2313 cpu = cpumask_first_and(cpu_mask, cpu_online_mask);
2314 if (cpu >= nr_cpu_ids) {
2315 if (its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144)
2316 return -EINVAL;
2317
2318 cpu = cpumask_first(cpu_online_mask);
2319 }
2320
2314 its_dev->event_map.col_map[event] = cpu; 2321 its_dev->event_map.col_map[event] = cpu;
2315 irq_data_update_effective_affinity(d, cpumask_of(cpu)); 2322 irq_data_update_effective_affinity(d, cpumask_of(cpu));
2316 2323