]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
10fa3cefb745d54e1e6a03a7745583e9be7d005c
[thirdparty/kernel/stable-queue.git] /
1 From f4a8ef6867bf285e1c0a26f11388a90f7b958f49 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 20 Oct 2020 16:15:32 +0800
4 Subject: irqchip/sifive-plic: Fix broken irq_set_affinity() callback
5
6 From: Greentime Hu <greentime.hu@sifive.com>
7
8 [ Upstream commit a7480c5d725c4ecfc627e70960f249c34f5d13e8 ]
9
10 An interrupt submitted to an affinity change will always be left enabled
11 after plic_set_affinity() has been called, while the expectation is that
12 it should stay in whatever state it was before the call.
13
14 Preserving the configuration fixes a PWM hang issue on the Unleashed
15 board.
16
17 [ 919.015783] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
18 [ 919.020922] rcu: 0-...0: (0 ticks this GP)
19 idle=7d2/1/0x4000000000000002 softirq=1424/1424 fqs=105807
20 [ 919.030295] (detected by 1, t=225825 jiffies, g=1561, q=3496)
21 [ 919.036109] Task dump for CPU 0:
22 [ 919.039321] kworker/0:1 R running task 0 30 2 0x00000008
23 [ 919.046359] Workqueue: events set_brightness_delayed
24 [ 919.051302] Call Trace:
25 [ 919.053738] [<ffffffe000930d92>] __schedule+0x194/0x4de
26 [ 982.035783] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
27 [ 982.040923] rcu: 0-...0: (0 ticks this GP)
28 idle=7d2/1/0x4000000000000002 softirq=1424/1424 fqs=113325
29 [ 982.050294] (detected by 1, t=241580 jiffies, g=1561, q=3509)
30 [ 982.056108] Task dump for CPU 0:
31 [ 982.059321] kworker/0:1 R running task 0 30 2 0x00000008
32 [ 982.066359] Workqueue: events set_brightness_delayed
33 [ 982.071302] Call Trace:
34 [ 982.073739] [<ffffffe000930d92>] __schedule+0x194/0x4de
35 [..]
36
37 Fixes: bb0fed1c60cc ("irqchip/sifive-plic: Switch to fasteoi flow")
38 Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
39 [maz: tidy-up commit message]
40 Signed-off-by: Marc Zyngier <maz@kernel.org>
41 Reviewed-by: Anup Patel <anup@brainfault.org>
42 Link: https://lore.kernel.org/r/20201020081532.2377-1-greentime.hu@sifive.com
43 Signed-off-by: Sasha Levin <sashal@kernel.org>
44 ---
45 drivers/irqchip/irq-sifive-plic.c | 2 +-
46 1 file changed, 1 insertion(+), 1 deletion(-)
47
48 diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
49 index eaa3e9fe54e91..4048657ece0ac 100644
50 --- a/drivers/irqchip/irq-sifive-plic.c
51 +++ b/drivers/irqchip/irq-sifive-plic.c
52 @@ -151,7 +151,7 @@ static int plic_set_affinity(struct irq_data *d,
53 return -EINVAL;
54
55 plic_irq_toggle(&priv->lmask, d, 0);
56 - plic_irq_toggle(cpumask_of(cpu), d, 1);
57 + plic_irq_toggle(cpumask_of(cpu), d, !irqd_irq_masked(d));
58
59 irq_data_update_effective_affinity(d, cpumask_of(cpu));
60
61 --
62 2.27.0
63