[omap]: switch the am335x-evmsk to the new wlcore bindings
[openwrt/svn-archive/archive.git] / target / linux / ramips / patches-3.10 / 0508-MIPS-GIC-Fix-gic_set_affinity-infinite-loop.patch
1 From 553ddf4f3f20c28ab03f87ac8c3cde5edf714675 Mon Sep 17 00:00:00 2001
2 From: Tony Wu <tung7970@gmail.com>
3 Date: Fri, 21 Jun 2013 10:13:08 +0000
4 Subject: [PATCH 022/105] MIPS: GIC: Fix gic_set_affinity infinite loop
5
6 There is an infinite loop in gic_set_affinity. When irq_set_affinity
7 gets called on gic controller, it blocks forever.
8
9 Signed-off-by: Tony Wu <tung7970@gmail.com>
10 Cc: Steven J. Hill <Steven.Hill@imgtec.com>
11 Cc: linux-mips@linux-mips.org
12 Patchwork: https://patchwork.linux-mips.org/patch/5537/
13 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 (cherry picked from commit c214c03512b67e56dea3f4471705f8caae49553a)
15 ---
16 arch/mips/kernel/irq-gic.c | 15 +++++++--------
17 1 file changed, 7 insertions(+), 8 deletions(-)
18
19 --- a/arch/mips/kernel/irq-gic.c
20 +++ b/arch/mips/kernel/irq-gic.c
21 @@ -219,16 +219,15 @@ static int gic_set_affinity(struct irq_d
22
23 /* Assumption : cpumask refers to a single CPU */
24 spin_lock_irqsave(&gic_lock, flags);
25 - for (;;) {
26 - /* Re-route this IRQ */
27 - GIC_SH_MAP_TO_VPE_SMASK(irq, first_cpu(tmp));
28
29 - /* Update the pcpu_masks */
30 - for (i = 0; i < NR_CPUS; i++)
31 - clear_bit(irq, pcpu_masks[i].pcpu_mask);
32 - set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask);
33 + /* Re-route this IRQ */
34 + GIC_SH_MAP_TO_VPE_SMASK(irq, first_cpu(tmp));
35 +
36 + /* Update the pcpu_masks */
37 + for (i = 0; i < NR_CPUS; i++)
38 + clear_bit(irq, pcpu_masks[i].pcpu_mask);
39 + set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask);
40
41 - }
42 cpumask_copy(d->affinity, cpumask);
43 spin_unlock_irqrestore(&gic_lock, flags);
44