bcm63xx: add 3.9 support
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.9 / 321-MIPS-BCM63XX-add-cpumask-argument-to-unmask.patch
1 From 8679976d2ec08db4e4a14ecdd1ee022b70e51fc6 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Tue, 30 Apr 2013 11:26:53 +0200
4 Subject: [PATCH 12/13] MIPS: BCM63XX: add cpumask argument to unmask
5
6 Allow selective unmasking of IPIC irqs.
7
8 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
9 ---
10 arch/mips/bcm63xx/irq.c | 19 +++++++++++++------
11 1 file changed, 13 insertions(+), 6 deletions(-)
12
13 --- a/arch/mips/bcm63xx/irq.c
14 +++ b/arch/mips/bcm63xx/irq.c
15 @@ -24,8 +24,10 @@ static void __dispatch_internal_32(int c
16 static void __dispatch_internal_64(int cpu) __maybe_unused;
17 static void __internal_irq_mask_32(unsigned int irq) __maybe_unused;
18 static void __internal_irq_mask_64(unsigned int irq) __maybe_unused;
19 -static void __internal_irq_unmask_32(unsigned int irq) __maybe_unused;
20 -static void __internal_irq_unmask_64(unsigned int irq) __maybe_unused;
21 +static void __internal_irq_unmask_32(unsigned int irq,
22 + const struct cpumask *dest) __maybe_unused;
23 +static void __internal_irq_unmask_64(unsigned int irq,
24 + const struct cpumask *dest) __maybe_unused;
25
26 static DEFINE_SPINLOCK(ipic_lock);
27 static DEFINE_SPINLOCK(epic_lock);
28 @@ -150,7 +152,8 @@ static unsigned int ext_irq_count;
29 static unsigned int ext_irq_start, ext_irq_end;
30 static unsigned int ext_irq_cfg_reg1, ext_irq_cfg_reg2;
31 static void (*internal_irq_mask)(unsigned int irq);
32 -static void (*internal_irq_unmask)(unsigned int irq);
33 +static void (*internal_irq_unmask)(unsigned int irq,
34 + const struct cpumask *dest);
35
36 static void bcm63xx_init_irq(void)
37 {
38 @@ -340,7 +343,8 @@ static void __internal_irq_mask_##width(
39 } \
40 } \
41 \
42 -static void __internal_irq_unmask_##width(unsigned int irq) \
43 +static void __internal_irq_unmask_##width(unsigned int irq, \
44 + const struct cpumask *dest) \
45 { \
46 u32 val; \
47 unsigned reg = (irq / 32) ^ (width/32 - 1); \
48 @@ -351,7 +355,10 @@ static void __internal_irq_unmask_##widt
49 u32 irq_mask_addr = get_irq_mask_addr(cpu); \
50 \
51 val = bcm_readl(irq_mask_addr + reg * sizeof(u32)); \
52 - val |= (1 << bit); \
53 + if (cpu_isset(cpu, *dest)) \
54 + val |= (1 << bit); \
55 + else \
56 + val &= ~(1 << bit); \
57 bcm_writel(val, irq_mask_addr + reg * sizeof(u32)); \
58 } \
59 }
60 @@ -413,7 +420,7 @@ static void bcm63xx_internal_irq_unmask(
61 unsigned long flags;
62
63 spin_lock_irqsave(&ipic_lock, flags);
64 - internal_irq_unmask(d->irq - IRQ_INTERNAL_BASE);
65 + internal_irq_unmask(d->irq - IRQ_INTERNAL_BASE, cpu_online_mask);
66 spin_unlock_irqrestore(&ipic_lock, flags);
67 }
68