Merge branch 'queue/irq/arm' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
authorOlof Johansson <olof@lixom.net>
Wed, 5 Aug 2015 15:24:11 +0000 (17:24 +0200)
committerOlof Johansson <olof@lixom.net>
Wed, 5 Aug 2015 15:24:11 +0000 (17:24 +0200)
Merge "ARM: Interrupt cleanups and API change preparation" from Thomas
Gleixner:

The following patch series contains the following changes:

    - Consolidation of chained interrupt handler setup/removal

    - Switch to functions which avoid a redundant interrupt
      descriptor lookup

    - Preparation of interrupt flow handlers for the 'irq' argument
      removal

* 'queue/irq/arm' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  ARM/orion/gpio: Prepare gpio_irq_handler for irq argument removal
  ARM/pxa: Prepare balloon3_irq_handler for irq argument removal
  ARM/pxa: Prepare *_irq_handler for irq argument removal
  ARM/dove: Prepare pmu_irq_handler for irq argument removal
  ARM/sa1111: Prepare sa1111_irq_handler for irq argument removal
  ARM/locomo: Prepare locomo_handler for irq argument removal
  ARM, irq: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc
  ARM/LPC32xx: Use irq_set_handler_locked()
  ARM/irq: Use access helper irq_data_get_affinity_mask()
  ARM/locomo: Consolidate chained IRQ handler install/remove
  ARM/orion: Consolidate chained IRQ handler install/remove

Signed-off-by: Olof Johansson <olof@lixom.net>
1  2 
arch/arm/common/locomo.c
arch/arm/common/sa1111.c
arch/arm/mach-dove/irq.c
arch/arm/mach-lpc32xx/irq.c
arch/arm/mach-pxa/balloon3.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/pcm990-baseboard.c
arch/arm/mach-pxa/viper.c
arch/arm/mach-pxa/zeus.c

diff --combined arch/arm/common/locomo.c
@@@ -138,9 -138,9 +138,9 @@@ static struct locomo_dev_info locomo_de
        },
  };
  
- static void locomo_handler(unsigned int irq, struct irq_desc *desc)
+ static void locomo_handler(unsigned int __irq, struct irq_desc *desc)
  {
-       struct locomo *lchip = irq_get_chip_data(irq);
+       struct locomo *lchip = irq_desc_get_chip_data(desc);
        int req, i;
  
        /* Acknowledge the parent IRQ */
        req = locomo_readl(lchip->base + LOCOMO_ICR) & 0x0f00;
  
        if (req) {
+               unsigned int irq;
                /* generate the next interrupt(s) */
                irq = lchip->irq_base;
                for (i = 0; i <= 3; i++, irq++) {
@@@ -205,7 -207,7 +207,7 @@@ static void locomo_setup_irq(struct loc
        for ( ; irq <= lchip->irq_base + 3; irq++) {
                irq_set_chip_and_handler(irq, &locomo_chip, handle_level_irq);
                irq_set_chip_data(irq, lchip);
 -              set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 +              irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
  }
  
@@@ -475,8 -477,7 +477,7 @@@ static void __locomo_remove(struct loco
        device_for_each_child(lchip->dev, NULL, locomo_remove_child);
  
        if (lchip->irq != NO_IRQ) {
-               irq_set_chained_handler(lchip->irq, NULL);
-               irq_set_handler_data(lchip->irq, NULL);
+               irq_set_chained_handler_and_data(lchip->irq, NULL, NULL);
        }
  
        iounmap(lchip->base);
diff --combined arch/arm/common/sa1111.c
@@@ -197,10 -197,11 +197,11 @@@ static struct sa1111_dev_info sa1111_de
   * will call us again if there are more interrupts to process.
   */
  static void
- sa1111_irq_handler(unsigned int irq, struct irq_desc *desc)
+ sa1111_irq_handler(unsigned int __irq, struct irq_desc *desc)
  {
+       unsigned int irq = irq_desc_get_irq(desc);
        unsigned int stat0, stat1, i;
-       struct sa1111 *sachip = irq_get_handler_data(irq);
+       struct sa1111 *sachip = irq_desc_get_handler_data(desc);
        void __iomem *mapbase = sachip->base + SA1111_INTC;
  
        stat0 = sa1111_readl(mapbase + SA1111_INTSTATCLR0);
@@@ -486,7 -487,7 +487,7 @@@ static int sa1111_setup_irq(struct sa11
                irq_set_chip_and_handler(irq, &sa1111_low_chip,
                                         handle_edge_irq);
                irq_set_chip_data(irq, sachip);
 -              set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 +              irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
  
        for (i = AUDXMTDMADONEA; i <= IRQ_S1_BVD1_STSCHG; i++) {
                irq_set_chip_and_handler(irq, &sa1111_high_chip,
                                         handle_edge_irq);
                irq_set_chip_data(irq, sachip);
 -              set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 +              irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
  
        /*
diff --combined arch/arm/mach-dove/irq.c
@@@ -69,8 -69,9 +69,9 @@@ static struct irq_chip pmu_irq_chip = 
        .irq_ack        = pmu_irq_ack,
  };
  
- static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc)
+ static void pmu_irq_handler(unsigned int __irq, struct irq_desc *desc)
  {
+       unsigned int irq = irq_desc_get_irq(desc);
        unsigned long cause = readl(PMU_INTERRUPT_CAUSE);
  
        cause &= readl(PMU_INTERRUPT_MASK);
@@@ -172,7 -173,7 +173,7 @@@ void __init dove_init_irq(void
        for (i = IRQ_DOVE_PMU_START; i < NR_IRQS; i++) {
                irq_set_chip_and_handler(i, &pmu_irq_chip, handle_level_irq);
                irq_set_status_flags(i, IRQ_LEVEL);
 -              set_irq_flags(i, IRQF_VALID);
 +              irq_clear_status_flags(i, IRQ_NOREQUEST);
        }
        irq_set_chained_handler(IRQ_DOVE_PMU, pmu_irq_handler);
  }
@@@ -283,25 -283,25 +283,25 @@@ static int lpc32xx_set_irq_type(struct 
        case IRQ_TYPE_EDGE_RISING:
                /* Rising edge sensitive */
                __lpc32xx_set_irq_type(d->hwirq, 1, 1);
-               __irq_set_handler_locked(d->irq, handle_edge_irq);
+               irq_set_handler_locked(d, handle_edge_irq);
                break;
  
        case IRQ_TYPE_EDGE_FALLING:
                /* Falling edge sensitive */
                __lpc32xx_set_irq_type(d->hwirq, 0, 1);
-               __irq_set_handler_locked(d->irq, handle_edge_irq);
+               irq_set_handler_locked(d, handle_edge_irq);
                break;
  
        case IRQ_TYPE_LEVEL_LOW:
                /* Low level sensitive */
                __lpc32xx_set_irq_type(d->hwirq, 0, 0);
-               __irq_set_handler_locked(d->irq, handle_level_irq);
+               irq_set_handler_locked(d, handle_level_irq);
                break;
  
        case IRQ_TYPE_LEVEL_HIGH:
                /* High level sensitive */
                __lpc32xx_set_irq_type(d->hwirq, 1, 0);
-               __irq_set_handler_locked(d->irq, handle_level_irq);
+               irq_set_handler_locked(d, handle_level_irq);
                break;
  
        /* Other modes are not supported */
@@@ -434,7 -434,7 +434,7 @@@ void __init lpc32xx_init_irq(void
        for (i = 0; i < NR_IRQS; i++) {
                irq_set_chip_and_handler(i, &lpc32xx_irq_chip,
                                         handle_level_irq);
 -              set_irq_flags(i, IRQF_VALID);
 +              irq_clear_status_flags(i, IRQ_NOREQUEST);
        }
  
        /* Set default mappings */
@@@ -496,18 -496,18 +496,18 @@@ static struct irq_chip balloon3_irq_chi
        .irq_unmask     = balloon3_unmask_irq,
  };
  
- static void balloon3_irq_handler(unsigned int irq, struct irq_desc *desc)
+ static void balloon3_irq_handler(unsigned int __irq, struct irq_desc *desc)
  {
        unsigned long pending = __raw_readl(BALLOON3_INT_CONTROL_REG) &
                                        balloon3_irq_enabled;
        do {
-               /* clear useless edge notification */
-               if (desc->irq_data.chip->irq_ack) {
-                       struct irq_data *d;
+               struct irq_data *d = irq_desc_get_irq_data(desc);
+               struct irq_chip *chip = irq_data_get_chip(d);
+               unsigned int irq;
  
-                       d = irq_get_irq_data(BALLOON3_AUX_NIRQ);
-                       desc->irq_data.chip->irq_ack(d);
-               }
+               /* clear useless edge notification */
+               if (chip->irq_ack)
+                       chip->irq_ack(d);
  
                while (pending) {
                        irq = BALLOON3_IRQ(0) + __ffs(pending);
@@@ -528,7 -528,7 +528,7 @@@ static void __init balloon3_init_irq(vo
        for (irq = BALLOON3_IRQ(0); irq <= BALLOON3_IRQ(7); irq++) {
                irq_set_chip_and_handler(irq, &balloon3_irq_chip,
                                         handle_level_irq);
 -              set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 +              irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
  
        irq_set_chained_handler(BALLOON3_AUX_NIRQ, balloon3_irq_handler);
@@@ -120,8 -120,9 +120,9 @@@ static struct irq_chip lpd270_irq_chip 
        .irq_unmask     = lpd270_unmask_irq,
  };
  
- static void lpd270_irq_handler(unsigned int irq, struct irq_desc *desc)
+ static void lpd270_irq_handler(unsigned int __irq, struct irq_desc *desc)
  {
+       unsigned int irq;
        unsigned long pending;
  
        pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled;
@@@ -151,7 -152,7 +152,7 @@@ static void __init lpd270_init_irq(void
        for (irq = LPD270_IRQ(2); irq <= LPD270_IRQ(4); irq++) {
                irq_set_chip_and_handler(irq, &lpd270_irq_chip,
                                         handle_level_irq);
 -              set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 +              irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
        irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), lpd270_irq_handler);
        irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING);
@@@ -284,8 -284,9 +284,9 @@@ static struct irq_chip pcm990_irq_chip 
        .irq_unmask     = pcm990_unmask_irq,
  };
  
- static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc)
+ static void pcm990_irq_handler(unsigned int __irq, struct irq_desc *desc)
  {
+       unsigned int irq;
        unsigned long pending;
  
        pending = ~pcm990_cpld_readb(PCM990_CTRL_INTSETCLR);
@@@ -311,7 -312,7 +312,7 @@@ static void __init pcm990_init_irq(void
        for (irq = PCM027_IRQ(0); irq <= PCM027_IRQ(3); irq++) {
                irq_set_chip_and_handler(irq, &pcm990_irq_chip,
                                         handle_level_irq);
 -              set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 +              irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
  
        /* disable all Interrupts */
@@@ -276,8 -276,9 +276,9 @@@ static inline unsigned long viper_irq_p
                        viper_irq_enabled_mask;
  }
  
- static void viper_irq_handler(unsigned int irq, struct irq_desc *desc)
+ static void viper_irq_handler(unsigned int __irq, struct irq_desc *desc)
  {
+       unsigned int irq;
        unsigned long pending;
  
        pending = viper_irq_pending();
@@@ -313,7 -314,7 +314,7 @@@ static void __init viper_init_irq(void
                isa_irq = viper_bit_to_irq(level);
                irq_set_chip_and_handler(isa_irq, &viper_irq_chip,
                                         handle_edge_irq);
 -              set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE);
 +              irq_clear_status_flags(isa_irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
  
        irq_set_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO),
diff --combined arch/arm/mach-pxa/zeus.c
@@@ -105,8 -105,9 +105,9 @@@ static inline unsigned long zeus_irq_pe
        return __raw_readw(ZEUS_CPLD_ISA_IRQ) & zeus_irq_enabled_mask;
  }
  
- static void zeus_irq_handler(unsigned int irq, struct irq_desc *desc)
+ static void zeus_irq_handler(unsigned int __irq, struct irq_desc *desc)
  {
+       unsigned int irq;
        unsigned long pending;
  
        pending = zeus_irq_pending();
@@@ -151,7 -152,7 +152,7 @@@ static void __init zeus_init_irq(void
                isa_irq = zeus_bit_to_irq(level);
                irq_set_chip_and_handler(isa_irq, &zeus_irq_chip,
                                         handle_edge_irq);
 -              set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE);
 +              irq_clear_status_flags(isa_irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
  
        irq_set_irq_type(gpio_to_irq(ZEUS_ISA_GPIO), IRQ_TYPE_EDGE_RISING);