lantiq: add support for tplink images to .../image/Makefile
[openwrt.git] / target / linux / brcm63xx / patches-3.9 / 318-MIPS-BCM63XX-add-cpu-argument-to-dispatch-internal.patch
index 081ec18b3d66448108cb552860bc9e9d3fcb70fd..18377549a994fb11045c7dfa9f72800f20b76fd7 100644 (file)
@@ -1,12 +1,12 @@
-From 398337c57ebe3c704e0df5f569e6bd860ffe8914 Mon Sep 17 00:00:00 2001
+From b6b668f780d62d41bc14bc7baba1692e17cabf84 Mon Sep 17 00:00:00 2001
 From: Jonas Gorski <jogo@openwrt.org>
 Date: Fri, 26 Apr 2013 11:21:16 +0200
-Subject: [PATCH 09/13] MIPS: BCM63XX: add cpu argument to dispatch internal
+Subject: [PATCH 10/14] MIPS: BCM63XX: add cpu argument to dispatch internal
 
 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 ---
- arch/mips/bcm63xx/irq.c |   14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
+ arch/mips/bcm63xx/irq.c |   21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
 
 --- a/arch/mips/bcm63xx/irq.c
 +++ b/arch/mips/bcm63xx/irq.c
@@ -21,7 +21,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  static void __internal_irq_mask_32(unsigned int irq) __maybe_unused;
  static void __internal_irq_mask_64(unsigned int irq) __maybe_unused;
  static void __internal_irq_unmask_32(unsigned int irq) __maybe_unused;
-@@ -140,7 +140,7 @@ static inline void bcm63xx_init_irq(void
+@@ -158,7 +158,7 @@ static inline void bcm63xx_init_irq(void
  #else /* ! BCMCPU_RUNTIME_DETECT */
  
  static u32 irq_stat_addr0, irq_mask_addr0, irq_stat_addr1, irq_mask_addr1;
@@ -30,7 +30,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  static int is_ext_irq_cascaded;
  static unsigned int ext_irq_count;
  static unsigned int ext_irq_start, ext_irq_end;
-@@ -282,14 +282,14 @@ static inline void handle_internal(int i
+@@ -315,14 +315,15 @@ static inline void handle_internal(int i
   */
  
  #define BUILD_IPIC_INTERNAL(width)                                    \
@@ -40,15 +40,29 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
        u32 pending[width / 32];                                        \
        unsigned int src, tgt;                                          \
        bool irqs_pending = false;                                      \
-       static int i;                                                   \
+-      static int i;                                                   \
 -      u32 irq_stat_addr = get_irq_stat_addr(0);                       \
 -      u32 irq_mask_addr = get_irq_mask_addr(0);                       \
++      static int i[NR_CPUS];                                          \
 +      u32 irq_stat_addr = get_irq_stat_addr(cpu);                     \
 +      u32 irq_mask_addr = get_irq_mask_addr(cpu);                     \
++      int *next = &i[cpu];                                            \
                                                                        \
        /* read registers in reverse order */                           \
        for (src = 0, tgt = (width / 32); src < (width / 32); src++) {  \
-@@ -361,7 +361,7 @@ asmlinkage void plat_irq_dispatch(void)
+@@ -340,9 +341,9 @@ void __dispatch_internal_##width(void)
+               return;                                                 \
+                                                                       \
+       while (1) {                                                     \
+-              int to_call = i;                                        \
++              int to_call = *next;                                    \
+                                                                       \
+-              i = (i + 1) & (width - 1);                              \
++              *next = (*next + 1) & (width - 1);                      \
+               if (pending[to_call / 32] & (1 << (to_call & 0x1f))) {  \
+                       handle_internal(to_call);                       \
+                       break;                                          \
+@@ -394,7 +395,7 @@ asmlinkage void plat_irq_dispatch(void)
                if (cause & CAUSEF_IP1)
                        do_IRQ(1);
                if (cause & CAUSEF_IP2)