]>
Commit | Line | Data |
---|---|---|
256d7bf6 GKH |
1 | From a040803a9d6b8c1876d3487a5cb69602ebcbb82c Mon Sep 17 00:00:00 2001 |
2 | From: Sudeep Holla <sudeep.holla@arm.com> | |
3 | Date: Mon, 1 Sep 2014 17:14:29 +0100 | |
4 | Subject: ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs | |
5 | ||
6 | From: Sudeep Holla <sudeep.holla@arm.com> | |
7 | ||
8 | commit a040803a9d6b8c1876d3487a5cb69602ebcbb82c upstream. | |
9 | ||
10 | Since commit 1dbfa187dad ("ARM: irq migration: force migration off CPU | |
11 | going down") the ARM interrupt migration code on cpu offline calls | |
12 | irqchip.irq_set_affinity() with the argument force=true. At the point | |
13 | of this change the argument had no effect because it was not used by | |
14 | any interrupt chip driver and there was no semantics defined. | |
15 | ||
16 | This changed with commit 01f8fa4f01d8 ("genirq: Allow forcing cpu | |
17 | affinity of interrupts") which made the force argument useful to route | |
18 | interrupts to not yet online cpus without checking the target cpu | |
19 | against the cpu online mask. The following commit ffde1de64012 | |
20 | ("irqchip: gic: Support forced affinity setting") implemented this for | |
21 | the GIC interrupt controller. | |
22 | ||
23 | As a consequence the ARM cpu offline irq migration fails if CPU0 is | |
24 | offlined, because CPU0 is still set in the affinity mask and the | |
25 | validataion against cpu online mask is skipped to the force argument | |
26 | being true. The following first_cpu(mask) selection always selects | |
27 | CPU0 as the target. | |
28 | ||
29 | Solve the issue by calling irq_set_affinity() with force=false from | |
30 | the CPU offline irq migration code so the GIC driver validates the | |
31 | affinity mask against CPU online mask and therefore removes CPU0 from | |
32 | the possible target candidates. | |
33 | ||
34 | Tested on TC2 hotpluging CPU0 in and out. Without this patch the system | |
35 | locks up as the IRQs are not migrated away from CPU0. | |
36 | ||
37 | Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> | |
38 | Acked-by: Thomas Gleixner <tglx@linutronix.de> | |
39 | Acked-by: Mark Rutland <mark.rutland@arm.com> | |
40 | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> | |
41 | Signed-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; |