]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.10.56/arm-8133-1-use-irq_set_affinity-with-force-false-when-migrating-irqs.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.56 / arm-8133-1-use-irq_set_affinity-with-force-false-when-migrating-irqs.patch
CommitLineData
256d7bf6
GKH
1From a040803a9d6b8c1876d3487a5cb69602ebcbb82c Mon Sep 17 00:00:00 2001
2From: Sudeep Holla <sudeep.holla@arm.com>
3Date: Mon, 1 Sep 2014 17:14:29 +0100
4Subject: ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs
5
6From: Sudeep Holla <sudeep.holla@arm.com>
7
8commit a040803a9d6b8c1876d3487a5cb69602ebcbb82c upstream.
9
10Since commit 1dbfa187dad ("ARM: irq migration: force migration off CPU
11going down") the ARM interrupt migration code on cpu offline calls
12irqchip.irq_set_affinity() with the argument force=true. At the point
13of this change the argument had no effect because it was not used by
14any interrupt chip driver and there was no semantics defined.
15
16This changed with commit 01f8fa4f01d8 ("genirq: Allow forcing cpu
17affinity of interrupts") which made the force argument useful to route
18interrupts to not yet online cpus without checking the target cpu
19against the cpu online mask. The following commit ffde1de64012
20("irqchip: gic: Support forced affinity setting") implemented this for
21the GIC interrupt controller.
22
23As a consequence the ARM cpu offline irq migration fails if CPU0 is
24offlined, because CPU0 is still set in the affinity mask and the
25validataion against cpu online mask is skipped to the force argument
26being true. The following first_cpu(mask) selection always selects
27CPU0 as the target.
28
29Solve the issue by calling irq_set_affinity() with force=false from
30the CPU offline irq migration code so the GIC driver validates the
31affinity mask against CPU online mask and therefore removes CPU0 from
32the possible target candidates.
33
34Tested on TC2 hotpluging CPU0 in and out. Without this patch the system
35locks up as the IRQs are not migrated away from CPU0.
36
37Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
38Acked-by: Thomas Gleixner <tglx@linutronix.de>
39Acked-by: Mark Rutland <mark.rutland@arm.com>
40Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
41Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
42
43---
44 arch/arm/kernel/irq.c | 2 +-
45 1 file changed, 1 insertion(+), 1 deletion(-)
46
47--- a/arch/arm/kernel/irq.c
48+++ b/arch/arm/kernel/irq.c
49@@ -163,7 +163,7 @@ static bool migrate_one_irq(struct irq_d
50 c = irq_data_get_irq_chip(d);
51 if (!c->irq_set_affinity)
52 pr_debug("IRQ%u: unable to set affinity\n", d->irq);
53- else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
54+ else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
55 cpumask_copy(d->affinity, affinity);
56
57 return ret;