Changeset 44714


Ignore:
Timestamp:
2015-03-13T03:59:19+01:00 (3 years ago)
Author:
nbd
Message:

atheros: v3.18: rearrange interrupt handling functions

No functional changes, just change functions order in source file.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@…>

Location:
trunk/target/linux/atheros/patches-3.18
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/atheros/patches-3.18/100-board.patch

    r44713 r44714  
    15271527+#include "ar5312.h" 
    15281528+ 
     1529+static irqreturn_t ar5312_ahb_err_handler(int cpl, void *dev_id) 
     1530+{ 
     1531+       u32 proc1 = ar231x_read_reg(AR5312_PROC1); 
     1532+       u32 proc_addr = ar231x_read_reg(AR5312_PROCADDR); /* clears error */ 
     1533+       u32 dma1 = ar231x_read_reg(AR5312_DMA1); 
     1534+       u32 dma_addr = ar231x_read_reg(AR5312_DMAADDR);   /* clears error */ 
     1535+ 
     1536+       pr_emerg("AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x DMAADDR=0x%8.8x DMA1=0x%8.8x\n", 
     1537+                proc_addr, proc1, dma_addr, dma1); 
     1538+ 
     1539+       machine_restart("AHB error"); /* Catastrophic failure */ 
     1540+       return IRQ_HANDLED; 
     1541+} 
     1542+ 
     1543+static struct irqaction ar5312_ahb_err_interrupt  = { 
     1544+       .handler = ar5312_ahb_err_handler, 
     1545+       .name    = "ar5312-ahb-error", 
     1546+}; 
     1547+ 
    15291548+static void ar5312_misc_irq_handler(unsigned irq, struct irq_desc *desc) 
    15301549+{ 
     
    15441563+               spurious_interrupt(); 
    15451564+} 
     1565+ 
     1566+/* Enable the specified AR5312_MISC_IRQ interrupt */ 
     1567+static void ar5312_misc_irq_unmask(struct irq_data *d) 
     1568+{ 
     1569+       unsigned int imr; 
     1570+ 
     1571+       imr = ar231x_read_reg(AR5312_IMR); 
     1572+       imr |= 1 << (d->irq - AR231X_MISC_IRQ_BASE); 
     1573+       ar231x_write_reg(AR5312_IMR, imr); 
     1574+} 
     1575+ 
     1576+/* Disable the specified AR5312_MISC_IRQ interrupt */ 
     1577+static void ar5312_misc_irq_mask(struct irq_data *d) 
     1578+{ 
     1579+       unsigned int imr; 
     1580+ 
     1581+       imr = ar231x_read_reg(AR5312_IMR); 
     1582+       imr &= ~(1 << (d->irq - AR231X_MISC_IRQ_BASE)); 
     1583+       ar231x_write_reg(AR5312_IMR, imr); 
     1584+       ar231x_read_reg(AR5312_IMR); /* flush write buffer */ 
     1585+} 
     1586+ 
     1587+static struct irq_chip ar5312_misc_irq_chip = { 
     1588+       .name           = "ar5312-misc", 
     1589+       .irq_unmask     = ar5312_misc_irq_unmask, 
     1590+       .irq_mask       = ar5312_misc_irq_mask, 
     1591+}; 
    15461592+ 
    15471593+static void ar5312_irq_dispatch(void) 
     
    15641610+               spurious_interrupt(); 
    15651611+} 
    1566 + 
    1567 +/* Enable the specified AR5312_MISC_IRQ interrupt */ 
    1568 +static void ar5312_misc_irq_unmask(struct irq_data *d) 
    1569 +{ 
    1570 +       unsigned int imr; 
    1571 + 
    1572 +       imr = ar231x_read_reg(AR5312_IMR); 
    1573 +       imr |= 1 << (d->irq - AR231X_MISC_IRQ_BASE); 
    1574 +       ar231x_write_reg(AR5312_IMR, imr); 
    1575 +} 
    1576 + 
    1577 +/* Disable the specified AR5312_MISC_IRQ interrupt */ 
    1578 +static void ar5312_misc_irq_mask(struct irq_data *d) 
    1579 +{ 
    1580 +       unsigned int imr; 
    1581 + 
    1582 +       imr = ar231x_read_reg(AR5312_IMR); 
    1583 +       imr &= ~(1 << (d->irq - AR231X_MISC_IRQ_BASE)); 
    1584 +       ar231x_write_reg(AR5312_IMR, imr); 
    1585 +       ar231x_read_reg(AR5312_IMR); /* flush write buffer */ 
    1586 +} 
    1587 + 
    1588 +static struct irq_chip ar5312_misc_irq_chip = { 
    1589 +       .name           = "ar5312-misc", 
    1590 +       .irq_unmask     = ar5312_misc_irq_unmask, 
    1591 +       .irq_mask       = ar5312_misc_irq_mask, 
    1592 +}; 
    1593 + 
    1594 +static irqreturn_t ar5312_ahb_err_handler(int cpl, void *dev_id) 
    1595 +{ 
    1596 +       u32 proc1 = ar231x_read_reg(AR5312_PROC1); 
    1597 +       u32 proc_addr = ar231x_read_reg(AR5312_PROCADDR); /* clears error */ 
    1598 +       u32 dma1 = ar231x_read_reg(AR5312_DMA1); 
    1599 +       u32 dma_addr = ar231x_read_reg(AR5312_DMAADDR);   /* clears error */ 
    1600 + 
    1601 +       pr_emerg("AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x DMAADDR=0x%8.8x DMA1=0x%8.8x\n", 
    1602 +                proc_addr, proc1, dma_addr, dma1); 
    1603 + 
    1604 +       machine_restart("AHB error"); /* Catastrophic failure */ 
    1605 +       return IRQ_HANDLED; 
    1606 +} 
    1607 + 
    1608 +static struct irqaction ar5312_ahb_err_interrupt  = { 
    1609 +       .handler = ar5312_ahb_err_handler, 
    1610 +       .name    = "ar5312-ahb-error", 
    1611 +}; 
    16121612+ 
    16131613+void __init ar5312_arch_init_irq(void) 
     
    19801980+#include "ar2315.h" 
    19811981+ 
     1982+static irqreturn_t ar2315_ahb_err_handler(int cpl, void *dev_id) 
     1983+{ 
     1984+       ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET); 
     1985+       ar231x_read_reg(AR2315_AHB_ERR1); 
     1986+ 
     1987+       pr_emerg("AHB fatal error\n"); 
     1988+       machine_restart("AHB error"); /* Catastrophic failure */ 
     1989+ 
     1990+       return IRQ_HANDLED; 
     1991+} 
     1992+ 
     1993+static struct irqaction ar2315_ahb_err_interrupt  = { 
     1994+       .handler        = ar2315_ahb_err_handler, 
     1995+       .name           = "ar2315-ahb-error", 
     1996+}; 
     1997+ 
    19821998+static void ar2315_misc_irq_handler(unsigned irq, struct irq_desc *desc) 
    19831999+{ 
     
    20032019+} 
    20042020+ 
     2021+static void ar2315_misc_irq_unmask(struct irq_data *d) 
     2022+{ 
     2023+       unsigned int imr; 
     2024+ 
     2025+       imr = ar231x_read_reg(AR2315_IMR); 
     2026+       imr |= 1 << (d->irq - AR231X_MISC_IRQ_BASE); 
     2027+       ar231x_write_reg(AR2315_IMR, imr); 
     2028+} 
     2029+ 
     2030+static void ar2315_misc_irq_mask(struct irq_data *d) 
     2031+{ 
     2032+       unsigned int imr; 
     2033+ 
     2034+       imr = ar231x_read_reg(AR2315_IMR); 
     2035+       imr &= ~(1 << (d->irq - AR231X_MISC_IRQ_BASE)); 
     2036+       ar231x_write_reg(AR2315_IMR, imr); 
     2037+} 
     2038+ 
     2039+static struct irq_chip ar2315_misc_irq_chip = { 
     2040+       .name           = "ar2315-misc", 
     2041+       .irq_unmask     = ar2315_misc_irq_unmask, 
     2042+       .irq_mask       = ar2315_misc_irq_mask, 
     2043+}; 
     2044+ 
    20052045+/* 
    20062046+ * Called when an interrupt is received, this function 
     
    20262066+               spurious_interrupt(); 
    20272067+} 
    2028 + 
    2029 +static void ar2315_misc_irq_unmask(struct irq_data *d) 
    2030 +{ 
    2031 +       unsigned int imr; 
    2032 + 
    2033 +       imr = ar231x_read_reg(AR2315_IMR); 
    2034 +       imr |= 1 << (d->irq - AR231X_MISC_IRQ_BASE); 
    2035 +       ar231x_write_reg(AR2315_IMR, imr); 
    2036 +} 
    2037 + 
    2038 +static void ar2315_misc_irq_mask(struct irq_data *d) 
    2039 +{ 
    2040 +       unsigned int imr; 
    2041 + 
    2042 +       imr = ar231x_read_reg(AR2315_IMR); 
    2043 +       imr &= ~(1 << (d->irq - AR231X_MISC_IRQ_BASE)); 
    2044 +       ar231x_write_reg(AR2315_IMR, imr); 
    2045 +} 
    2046 + 
    2047 +static struct irq_chip ar2315_misc_irq_chip = { 
    2048 +       .name           = "ar2315-misc", 
    2049 +       .irq_unmask     = ar2315_misc_irq_unmask, 
    2050 +       .irq_mask       = ar2315_misc_irq_mask, 
    2051 +}; 
    2052 + 
    2053 +static irqreturn_t ar2315_ahb_err_handler(int cpl, void *dev_id) 
    2054 +{ 
    2055 +       ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET); 
    2056 +       ar231x_read_reg(AR2315_AHB_ERR1); 
    2057 + 
    2058 +       pr_emerg("AHB fatal error\n"); 
    2059 +       machine_restart("AHB error"); /* Catastrophic failure */ 
    2060 + 
    2061 +       return IRQ_HANDLED; 
    2062 +} 
    2063 + 
    2064 +static struct irqaction ar2315_ahb_err_interrupt  = { 
    2065 +       .handler        = ar2315_ahb_err_handler, 
    2066 +       .name           = "ar2315-ahb-error", 
    2067 +}; 
    20682068+ 
    20692069+void __init ar2315_arch_init_irq(void) 
  • trunk/target/linux/atheros/patches-3.18/105-ar2315_pci.patch

    r44713 r44714  
    372372--- a/arch/mips/ath25/ar2315.c 
    373373+++ b/arch/mips/ath25/ar2315.c 
    374 @@ -76,6 +76,10 @@ static void ar2315_irq_dispatch(void) 
     374@@ -116,6 +116,10 @@ static void ar2315_irq_dispatch(void) 
    375375                do_IRQ(AR2315_IRQ_WLAN0_INTRS); 
    376376        else if (pending & CAUSEF_IP4) 
Note: See TracChangeset for help on using the changeset viewer.