atheros: v3.18: rearrange interrupt handling functions
authorFelix Fietkau <nbd@openwrt.org>
Fri, 13 Mar 2015 02:59:19 +0000 (02:59 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 13 Mar 2015 02:59:19 +0000 (02:59 +0000)
No functional changes, just change functions order in source file.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
SVN-Revision: 44714

target/linux/atheros/patches-3.18/100-board.patch
target/linux/atheros/patches-3.18/105-ar2315_pci.patch

index c28a1d81d961ecbe9f0ee3665d7490fe27ccd733..1e39990a2b5c5cc1a108f9ce3e6def7094697656 100644 (file)
 +#include "devices.h"
 +#include "ar5312.h"
 +
++static irqreturn_t ar5312_ahb_err_handler(int cpl, void *dev_id)
++{
++      u32 proc1 = ar231x_read_reg(AR5312_PROC1);
++      u32 proc_addr = ar231x_read_reg(AR5312_PROCADDR); /* clears error */
++      u32 dma1 = ar231x_read_reg(AR5312_DMA1);
++      u32 dma_addr = ar231x_read_reg(AR5312_DMAADDR);   /* clears error */
++
++      pr_emerg("AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x DMAADDR=0x%8.8x DMA1=0x%8.8x\n",
++               proc_addr, proc1, dma_addr, dma1);
++
++      machine_restart("AHB error"); /* Catastrophic failure */
++      return IRQ_HANDLED;
++}
++
++static struct irqaction ar5312_ahb_err_interrupt  = {
++      .handler = ar5312_ahb_err_handler,
++      .name    = "ar5312-ahb-error",
++};
++
 +static void ar5312_misc_irq_handler(unsigned irq, struct irq_desc *desc)
 +{
 +      unsigned int ar231x_misc_intrs = ar231x_read_reg(AR5312_ISR) &
 +              spurious_interrupt();
 +}
 +
-+static void ar5312_irq_dispatch(void)
-+{
-+      int pending = read_c0_status() & read_c0_cause();
-+
-+      if (pending & CAUSEF_IP2)
-+              do_IRQ(AR5312_IRQ_WLAN0_INTRS);
-+      else if (pending & CAUSEF_IP3)
-+              do_IRQ(AR5312_IRQ_ENET0_INTRS);
-+      else if (pending & CAUSEF_IP4)
-+              do_IRQ(AR5312_IRQ_ENET1_INTRS);
-+      else if (pending & CAUSEF_IP5)
-+              do_IRQ(AR5312_IRQ_WLAN1_INTRS);
-+      else if (pending & CAUSEF_IP6)
-+              do_IRQ(AR5312_IRQ_MISC_INTRS);
-+      else if (pending & CAUSEF_IP7)
-+              do_IRQ(AR231X_IRQ_CPU_CLOCK);
-+      else
-+              spurious_interrupt();
-+}
-+
 +/* Enable the specified AR5312_MISC_IRQ interrupt */
 +static void ar5312_misc_irq_unmask(struct irq_data *d)
 +{
 +      .irq_mask       = ar5312_misc_irq_mask,
 +};
 +
-+static irqreturn_t ar5312_ahb_err_handler(int cpl, void *dev_id)
++static void ar5312_irq_dispatch(void)
 +{
-+      u32 proc1 = ar231x_read_reg(AR5312_PROC1);
-+      u32 proc_addr = ar231x_read_reg(AR5312_PROCADDR); /* clears error */
-+      u32 dma1 = ar231x_read_reg(AR5312_DMA1);
-+      u32 dma_addr = ar231x_read_reg(AR5312_DMAADDR);   /* clears error */
-+
-+      pr_emerg("AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x DMAADDR=0x%8.8x DMA1=0x%8.8x\n",
-+               proc_addr, proc1, dma_addr, dma1);
++      int pending = read_c0_status() & read_c0_cause();
 +
-+      machine_restart("AHB error"); /* Catastrophic failure */
-+      return IRQ_HANDLED;
++      if (pending & CAUSEF_IP2)
++              do_IRQ(AR5312_IRQ_WLAN0_INTRS);
++      else if (pending & CAUSEF_IP3)
++              do_IRQ(AR5312_IRQ_ENET0_INTRS);
++      else if (pending & CAUSEF_IP4)
++              do_IRQ(AR5312_IRQ_ENET1_INTRS);
++      else if (pending & CAUSEF_IP5)
++              do_IRQ(AR5312_IRQ_WLAN1_INTRS);
++      else if (pending & CAUSEF_IP6)
++              do_IRQ(AR5312_IRQ_MISC_INTRS);
++      else if (pending & CAUSEF_IP7)
++              do_IRQ(AR231X_IRQ_CPU_CLOCK);
++      else
++              spurious_interrupt();
 +}
 +
-+static struct irqaction ar5312_ahb_err_interrupt  = {
-+      .handler = ar5312_ahb_err_handler,
-+      .name    = "ar5312-ahb-error",
-+};
-+
 +void __init ar5312_arch_init_irq(void)
 +{
 +      int i;
 +#include "devices.h"
 +#include "ar2315.h"
 +
++static irqreturn_t ar2315_ahb_err_handler(int cpl, void *dev_id)
++{
++      ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET);
++      ar231x_read_reg(AR2315_AHB_ERR1);
++
++      pr_emerg("AHB fatal error\n");
++      machine_restart("AHB error"); /* Catastrophic failure */
++
++      return IRQ_HANDLED;
++}
++
++static struct irqaction ar2315_ahb_err_interrupt  = {
++      .handler        = ar2315_ahb_err_handler,
++      .name           = "ar2315-ahb-error",
++};
++
 +static void ar2315_misc_irq_handler(unsigned irq, struct irq_desc *desc)
 +{
 +      unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) &
 +              spurious_interrupt();
 +}
 +
-+/*
-+ * Called when an interrupt is received, this function
-+ * determines exactly which interrupt it was, and it
-+ * invokes the appropriate handler.
-+ *
-+ * Implicitly, we also define interrupt priority by
-+ * choosing which to dispatch first.
-+ */
-+static void ar2315_irq_dispatch(void)
-+{
-+      int pending = read_c0_status() & read_c0_cause();
-+
-+      if (pending & CAUSEF_IP3)
-+              do_IRQ(AR2315_IRQ_WLAN0_INTRS);
-+      else if (pending & CAUSEF_IP4)
-+              do_IRQ(AR2315_IRQ_ENET0_INTRS);
-+      else if (pending & CAUSEF_IP2)
-+              do_IRQ(AR2315_IRQ_MISC_INTRS);
-+      else if (pending & CAUSEF_IP7)
-+              do_IRQ(AR231X_IRQ_CPU_CLOCK);
-+      else
-+              spurious_interrupt();
-+}
-+
 +static void ar2315_misc_irq_unmask(struct irq_data *d)
 +{
 +      unsigned int imr;
 +      .irq_mask       = ar2315_misc_irq_mask,
 +};
 +
-+static irqreturn_t ar2315_ahb_err_handler(int cpl, void *dev_id)
++/*
++ * Called when an interrupt is received, this function
++ * determines exactly which interrupt it was, and it
++ * invokes the appropriate handler.
++ *
++ * Implicitly, we also define interrupt priority by
++ * choosing which to dispatch first.
++ */
++static void ar2315_irq_dispatch(void)
 +{
-+      ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET);
-+      ar231x_read_reg(AR2315_AHB_ERR1);
-+
-+      pr_emerg("AHB fatal error\n");
-+      machine_restart("AHB error"); /* Catastrophic failure */
++      int pending = read_c0_status() & read_c0_cause();
 +
-+      return IRQ_HANDLED;
++      if (pending & CAUSEF_IP3)
++              do_IRQ(AR2315_IRQ_WLAN0_INTRS);
++      else if (pending & CAUSEF_IP4)
++              do_IRQ(AR2315_IRQ_ENET0_INTRS);
++      else if (pending & CAUSEF_IP2)
++              do_IRQ(AR2315_IRQ_MISC_INTRS);
++      else if (pending & CAUSEF_IP7)
++              do_IRQ(AR231X_IRQ_CPU_CLOCK);
++      else
++              spurious_interrupt();
 +}
 +
-+static struct irqaction ar2315_ahb_err_interrupt  = {
-+      .handler        = ar2315_ahb_err_handler,
-+      .name           = "ar2315-ahb-error",
-+};
-+
 +void __init ar2315_arch_init_irq(void)
 +{
 +      int i;
index 3c66d86fe950a6da1087808cc038acf9d1c3eb27..6a370f4701e340f3b099be86748810dab7489de4 100644 (file)
 +      default y
 --- a/arch/mips/ath25/ar2315.c
 +++ b/arch/mips/ath25/ar2315.c
-@@ -76,6 +76,10 @@ static void ar2315_irq_dispatch(void)
+@@ -116,6 +116,10 @@ static void ar2315_irq_dispatch(void)
                do_IRQ(AR2315_IRQ_WLAN0_INTRS);
        else if (pending & CAUSEF_IP4)
                do_IRQ(AR2315_IRQ_ENET0_INTRS);