irq: remove handle_domain_{irq,nmi}()
authorMark Rutland <mark.rutland@arm.com>
Wed, 20 Oct 2021 19:23:09 +0000 (20:23 +0100)
committerMark Rutland <mark.rutland@arm.com>
Tue, 26 Oct 2021 09:13:31 +0000 (10:13 +0100)
Now that entry code handles IRQ entry (including setting the IRQ regs)
before calling irqchip code, irqchip code can safely call
generic_handle_domain_irq(), and there's no functional reason for it to
call handle_domain_irq().

Let's cement this split of responsibility and remove handle_domain_irq()
entirely, updating irqchip drivers to call generic_handle_domain_irq().

For consistency, handle_domain_nmi() is similarly removed and replaced
with a generic_handle_domain_nmi() function which also does not perform
any entry logic.

Previously handle_domain_{irq,nmi}() had a WARN_ON() which would fire
when they were called in an inappropriate context. So that we can
identify similar issues going forward, similar WARN_ON_ONCE() logic is
added to the generic_handle_*() functions, and comments are updated for
clarity and consistency.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
48 files changed:
Documentation/core-api/irq/irq-domain.rst
arch/arm/Kconfig
arch/arm/mach-imx/avic.c
arch/arm/mach-imx/tzic.c
arch/arm/mach-omap1/irq.c
arch/arm/mach-s3c/irq-s3c24xx.c
arch/arm64/Kconfig
arch/csky/Kconfig
arch/openrisc/Kconfig
arch/riscv/Kconfig
drivers/irqchip/irq-apple-aic.c
drivers/irqchip/irq-armada-370-xp.c
drivers/irqchip/irq-aspeed-vic.c
drivers/irqchip/irq-atmel-aic.c
drivers/irqchip/irq-atmel-aic5.c
drivers/irqchip/irq-bcm2835.c
drivers/irqchip/irq-bcm2836.c
drivers/irqchip/irq-clps711x.c
drivers/irqchip/irq-csky-apb-intc.c
drivers/irqchip/irq-csky-mpintc.c
drivers/irqchip/irq-davinci-aintc.c
drivers/irqchip/irq-davinci-cp-intc.c
drivers/irqchip/irq-digicolor.c
drivers/irqchip/irq-dw-apb-ictl.c
drivers/irqchip/irq-ftintc010.c
drivers/irqchip/irq-gic-v3.c
drivers/irqchip/irq-gic.c
drivers/irqchip/irq-hip04.c
drivers/irqchip/irq-ixp4xx.c
drivers/irqchip/irq-lpc32xx.c
drivers/irqchip/irq-mmp.c
drivers/irqchip/irq-mxs.c
drivers/irqchip/irq-nvic.c
drivers/irqchip/irq-omap-intc.c
drivers/irqchip/irq-or1k-pic.c
drivers/irqchip/irq-orion.c
drivers/irqchip/irq-rda-intc.c
drivers/irqchip/irq-riscv-intc.c
drivers/irqchip/irq-sa11x0.c
drivers/irqchip/irq-sun4i.c
drivers/irqchip/irq-versatile-fpga.c
drivers/irqchip/irq-vic.c
drivers/irqchip/irq-vt8500.c
drivers/irqchip/irq-wpcm450-aic.c
drivers/irqchip/irq-zevio.c
include/linux/irqdesc.h
kernel/irq/Kconfig
kernel/irq/irqdesc.c

index 9c0e8758037a1efbdcd9d9d26b387012444da67b..d30b4d0a9769c968fcd5f741d1d834f78c45d2fc 100644 (file)
@@ -67,9 +67,6 @@ variety of methods:
   deprecated
 - generic_handle_domain_irq() handles an interrupt described by a
   domain and a hwirq number
-- handle_domain_irq() does the same thing for root interrupt
-  controllers and deals with the set_irq_reg()/irq_enter() sequences
-  that most architecture requires
 
 Note that irq domain lookups must happen in contexts that are
 compatible with a RCU read-side critical section.
index fc196421b2cedb5ecf92eaeff32bcd907a2399d8..3361a6c29ee996e2e8603cca3339c62dae43ffcb 100644 (file)
@@ -64,7 +64,6 @@ config ARM
        select GENERIC_PCI_IOMAP
        select GENERIC_SCHED_CLOCK
        select GENERIC_SMP_IDLE_THREAD
-       select HANDLE_DOMAIN_IRQ
        select HARDIRQS_SW_RESEND
        select HAVE_ARCH_AUDITSYSCALL if AEABI && !OABI_COMPAT
        select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
index 21bce4049cec2e7d1607de0f1ba0a73adb5ef2fd..cf6546ddc7a3e70a359e800cb731aa65e44cb117 100644 (file)
@@ -154,7 +154,7 @@ static void __exception_irq_entry avic_handle_irq(struct pt_regs *regs)
                if (nivector == 0xffff)
                        break;
 
-               handle_domain_irq(domain, nivector, regs);
+               generic_handle_domain_irq(domain, nivector);
        } while (1);
 }
 
index 479a01bdac56f7d1116aacafc605a88280b5a799..8b3d98d288d93e43f8025263d1a6d3c5b33cb242 100644 (file)
@@ -134,7 +134,7 @@ static void __exception_irq_entry tzic_handle_irq(struct pt_regs *regs)
                        while (stat) {
                                handled = 1;
                                irqofs = fls(stat) - 1;
-                               handle_domain_irq(domain, irqofs + i * 32, regs);
+                               generic_handle_domain_irq(domain, irqofs + i * 32);
                                stat &= ~(1 << irqofs);
                        }
                }
index b11edc8a46f0ec0c549969987ebfaec803ae11ac..ee6a930831547d8ef727963505adc7013238af7f 100644 (file)
@@ -165,7 +165,7 @@ asmlinkage void __exception_irq_entry omap1_handle_irq(struct pt_regs *regs)
                }
 irq:
                if (irqnr)
-                       handle_domain_irq(domain, irqnr, regs);
+                       generic_handle_domain_irq(domain, irqnr);
                else
                        break;
        } while (irqnr);
index 3edc5f614eefc4f704dbdfc5658dd62ee55793d5..45dfd546e6fa844c161fba7f8ea12b26ee60bdf0 100644 (file)
@@ -354,7 +354,7 @@ static inline int s3c24xx_handle_intc(struct s3c_irq_intc *intc,
        if (!(pnd & (1 << offset)))
                offset =  __ffs(pnd);
 
-       handle_domain_irq(intc->domain, intc_offset + offset, regs);
+       generic_handle_domain_irq(intc->domain, intc_offset + offset);
        return true;
 }
 
index 5c7ae4c3954be956d9ca39b2f7795a52b6cfbb7f..e6593a03ea278687847505366ae41771bd20cf61 100644 (file)
@@ -133,7 +133,6 @@ config ARM64
        select GENERIC_TIME_VSYSCALL
        select GENERIC_GETTIMEOFDAY
        select GENERIC_VDSO_TIME_NS
-       select HANDLE_DOMAIN_IRQ
        select HARDIRQS_SW_RESEND
        select HAVE_MOVE_PMD
        select HAVE_MOVE_PUD
index 9d4d898df76ba717e7808afc4209e0cc20c4dafc..e0bd71b9e23fc3e06b160c730fc4ae1c335f8676 100644 (file)
@@ -17,7 +17,6 @@ config CSKY
        select CSKY_APB_INTC
        select DMA_DIRECT_REMAP
        select IRQ_DOMAIN
-       select HANDLE_DOMAIN_IRQ
        select DW_APB_TIMER_OF
        select GENERIC_IOREMAP
        select GENERIC_LIB_ASHLDI3
index e804026b4797cbd7ef381b21f9a953da7e54bdc7..c2491b295d6087c45f79ed8809d3b6c0b64f37ca 100644 (file)
@@ -13,7 +13,6 @@ config OPENRISC
        select OF
        select OF_EARLY_FLATTREE
        select IRQ_DOMAIN
-       select HANDLE_DOMAIN_IRQ
        select GPIOLIB
        select HAVE_ARCH_TRACEHOOK
        select SPARSE_IRQ
index 301a54233c7e26a598eb63f4a75aad9301c12141..353e28f5f849bcc030ab8ca256856d8a4227e127 100644 (file)
@@ -62,7 +62,6 @@ config RISCV
        select GENERIC_SCHED_CLOCK
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_TIME_VSYSCALL if MMU && 64BIT
-       select HANDLE_DOMAIN_IRQ
        select HAVE_ARCH_AUDITSYSCALL
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
        select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
index 6fc145aacaf029c4cb50c3d91b783b09514dc1e8..3759dc36cc8f73f664e10e8ed6c8fd2ceca1754f 100644 (file)
@@ -245,7 +245,7 @@ static void __exception_irq_entry aic_handle_irq(struct pt_regs *regs)
                irq = FIELD_GET(AIC_EVENT_NUM, event);
 
                if (type == AIC_EVENT_TYPE_HW)
-                       handle_domain_irq(aic_irqc->hw_domain, irq, regs);
+                       generic_handle_domain_irq(aic_irqc->hw_domain, irq);
                else if (type == AIC_EVENT_TYPE_IPI && irq == 1)
                        aic_handle_ipi(regs);
                else if (event != 0)
@@ -392,25 +392,25 @@ static void __exception_irq_entry aic_handle_fiq(struct pt_regs *regs)
        }
 
        if (TIMER_FIRING(read_sysreg(cntp_ctl_el0)))
-               handle_domain_irq(aic_irqc->hw_domain,
-                                 aic_irqc->nr_hw + AIC_TMR_EL0_PHYS, regs);
+               generic_handle_domain_irq(aic_irqc->hw_domain,
+                                         aic_irqc->nr_hw + AIC_TMR_EL0_PHYS);
 
        if (TIMER_FIRING(read_sysreg(cntv_ctl_el0)))
-               handle_domain_irq(aic_irqc->hw_domain,
-                                 aic_irqc->nr_hw + AIC_TMR_EL0_VIRT, regs);
+               generic_handle_domain_irq(aic_irqc->hw_domain,
+                                         aic_irqc->nr_hw + AIC_TMR_EL0_VIRT);
 
        if (is_kernel_in_hyp_mode()) {
                uint64_t enabled = read_sysreg_s(SYS_IMP_APL_VM_TMR_FIQ_ENA_EL2);
 
                if ((enabled & VM_TMR_FIQ_ENABLE_P) &&
                    TIMER_FIRING(read_sysreg_s(SYS_CNTP_CTL_EL02)))
-                       handle_domain_irq(aic_irqc->hw_domain,
-                                         aic_irqc->nr_hw + AIC_TMR_EL02_PHYS, regs);
+                       generic_handle_domain_irq(aic_irqc->hw_domain,
+                                                 aic_irqc->nr_hw + AIC_TMR_EL02_PHYS);
 
                if ((enabled & VM_TMR_FIQ_ENABLE_V) &&
                    TIMER_FIRING(read_sysreg_s(SYS_CNTV_CTL_EL02)))
-                       handle_domain_irq(aic_irqc->hw_domain,
-                                         aic_irqc->nr_hw + AIC_TMR_EL02_VIRT, regs);
+                       generic_handle_domain_irq(aic_irqc->hw_domain,
+                                                 aic_irqc->nr_hw + AIC_TMR_EL02_VIRT);
        }
 
        if ((read_sysreg_s(SYS_IMP_APL_PMCR0_EL1) & (PMCR0_IMODE | PMCR0_IACT)) ==
@@ -674,7 +674,7 @@ static void aic_handle_ipi(struct pt_regs *regs)
        firing = atomic_fetch_andnot(enabled, this_cpu_ptr(&aic_vipi_flag)) & enabled;
 
        for_each_set_bit(i, &firing, AIC_NR_SWIPI)
-               handle_domain_irq(aic_irqc->ipi_domain, i, regs);
+               generic_handle_domain_irq(aic_irqc->ipi_domain, i);
 
        /*
         * No ordering needed here; at worst this just changes the timing of
index 53e0fb0562c11552f20dad9e5889a80b20001cad..80906bfec845f7c2f25b06ce2adabf06164bce22 100644 (file)
@@ -589,12 +589,7 @@ static void armada_370_xp_handle_msi_irq(struct pt_regs *regs, bool is_chained)
 
                irq = msinr - PCI_MSI_DOORBELL_START;
 
-               if (is_chained)
-                       generic_handle_domain_irq(armada_370_xp_msi_inner_domain,
-                                                 irq);
-               else
-                       handle_domain_irq(armada_370_xp_msi_inner_domain,
-                                         irq, regs);
+               generic_handle_domain_irq(armada_370_xp_msi_inner_domain, irq);
        }
 }
 #else
@@ -646,8 +641,8 @@ armada_370_xp_handle_irq(struct pt_regs *regs)
                        break;
 
                if (irqnr > 1) {
-                       handle_domain_irq(armada_370_xp_mpic_domain,
-                                         irqnr, regs);
+                       generic_handle_domain_irq(armada_370_xp_mpic_domain,
+                                                 irqnr);
                        continue;
                }
 
@@ -666,7 +661,7 @@ armada_370_xp_handle_irq(struct pt_regs *regs)
                                & IPI_DOORBELL_MASK;
 
                        for_each_set_bit(ipi, &ipimask, IPI_DOORBELL_END)
-                               handle_domain_irq(ipi_domain, ipi, regs);
+                               generic_handle_domain_irq(ipi_domain, ipi);
                }
 #endif
 
index 58717cd44f99f1545fab75a56bb4fecad43f1906..62ccf2c0c4143ea91f979f09b4c135403e4f5700 100644 (file)
@@ -100,7 +100,7 @@ static void __exception_irq_entry avic_handle_irq(struct pt_regs *regs)
                if (stat == 0)
                        break;
                irq += ffs(stat) - 1;
-               handle_domain_irq(vic->dom, irq, regs);
+               generic_handle_domain_irq(vic->dom, irq);
        }
 }
 
index 2c999dc310c10756236ab87e36e22600a03c1e8c..4631f68479537b393a45bbfad1d6416115b6dc8f 100644 (file)
@@ -71,7 +71,7 @@ aic_handle(struct pt_regs *regs)
        if (!irqstat)
                irq_reg_writel(gc, 0, AT91_AIC_EOICR);
        else
-               handle_domain_irq(aic_domain, irqnr, regs);
+               generic_handle_domain_irq(aic_domain, irqnr);
 }
 
 static int aic_retrigger(struct irq_data *d)
index fb4ad2aaa727f78299a403673bbdc8628b5810e3..145535bd756058e60113ee486f73b743aadf9182 100644 (file)
@@ -80,7 +80,7 @@ aic5_handle(struct pt_regs *regs)
        if (!irqstat)
                irq_reg_writel(bgc, 0, AT91_AIC5_EOICR);
        else
-               handle_domain_irq(aic5_domain, irqnr, regs);
+               generic_handle_domain_irq(aic5_domain, irqnr);
 }
 
 static void aic5_mask(struct irq_data *d)
index adc1556ed332273dfcd5b5ee5b2cbe77e2af4f2a..e94e2882286cb25deb865858fc6304852d3f1029 100644 (file)
@@ -246,7 +246,7 @@ static void __exception_irq_entry bcm2835_handle_irq(
        u32 hwirq;
 
        while ((hwirq = get_next_armctrl_hwirq()) != ~0)
-               handle_domain_irq(intc.domain, hwirq, regs);
+               generic_handle_domain_irq(intc.domain, hwirq);
 }
 
 static void bcm2836_chained_handle_irq(struct irq_desc *desc)
index 501facdb4570ebae19d4eb4d4a5f5d415278f073..51491c3c6fdd2ddf27fedf03c3a1a36b374be7de 100644 (file)
@@ -143,7 +143,7 @@ __exception_irq_entry bcm2836_arm_irqchip_handle_irq(struct pt_regs *regs)
        if (stat) {
                u32 hwirq = ffs(stat) - 1;
 
-               handle_domain_irq(intc.domain, hwirq, regs);
+               generic_handle_domain_irq(intc.domain, hwirq);
        }
 }
 
index d0da29aeedc887315624f4b71fbdf504bb512d14..77ebe7e47e0e938f7ed5db0b90f374b48fee4d9f 100644 (file)
@@ -77,14 +77,14 @@ static asmlinkage void __exception_irq_entry clps711x_irqh(struct pt_regs *regs)
                irqstat = readw_relaxed(clps711x_intc->intmr[0]) &
                          readw_relaxed(clps711x_intc->intsr[0]);
                if (irqstat)
-                       handle_domain_irq(clps711x_intc->domain,
-                                         fls(irqstat) - 1, regs);
+                       generic_handle_domain_irq(clps711x_intc->domain,
+                                                 fls(irqstat) - 1);
 
                irqstat = readw_relaxed(clps711x_intc->intmr[1]) &
                          readw_relaxed(clps711x_intc->intsr[1]);
                if (irqstat)
-                       handle_domain_irq(clps711x_intc->domain,
-                                         fls(irqstat) - 1 + 16, regs);
+                       generic_handle_domain_irq(clps711x_intc->domain,
+                                                 fls(irqstat) - 1 + 16);
        } while (irqstat);
 }
 
index ab91afa867557bf9c13221091ef185d66f2b12c3..d36f536506ba48472bed47c93832aac7234a17f7 100644 (file)
@@ -138,7 +138,7 @@ static inline bool handle_irq_perbit(struct pt_regs *regs, u32 hwirq,
        if (hwirq == 0)
                return 0;
 
-       handle_domain_irq(root_domain, irq_base + __fls(hwirq), regs);
+       generic_handle_domain_irq(root_domain, irq_base + __fls(hwirq));
 
        return 1;
 }
index a1534edef7fa02be9e704776f5bf3a8bac096ca2..cb403c960ac04ea831849ea4a1ecfe2c9e1fa910 100644 (file)
@@ -74,8 +74,8 @@ static void csky_mpintc_handler(struct pt_regs *regs)
 {
        void __iomem *reg_base = this_cpu_read(intcl_reg);
 
-       handle_domain_irq(root_domain,
-               readl_relaxed(reg_base + INTCL_RDYIR), regs);
+       generic_handle_domain_irq(root_domain,
+               readl_relaxed(reg_base + INTCL_RDYIR));
 }
 
 static void csky_mpintc_enable(struct irq_data *d)
index 810ccc4fe4764b96ab10571414bd2e96f0a554c4..123eb7bfc11781dccf5de94c826a378568a17e0f 100644 (file)
@@ -73,7 +73,7 @@ davinci_aintc_handle_irq(struct pt_regs *regs)
        irqnr >>= 2;
        irqnr -= 1;
 
-       handle_domain_irq(davinci_aintc_irq_domain, irqnr, regs);
+       generic_handle_domain_irq(davinci_aintc_irq_domain, irqnr);
 }
 
 /* ARM Interrupt Controller Initialization */
index 276da2772e7f6080ebd57d5cda8222841572a860..7482c8ed34b23032a3706220bbbf11143542952e 100644 (file)
@@ -135,7 +135,7 @@ davinci_cp_intc_handle_irq(struct pt_regs *regs)
                return;
        }
 
-       handle_domain_irq(davinci_cp_intc_irq_domain, irqnr, regs);
+       generic_handle_domain_irq(davinci_cp_intc_irq_domain, irqnr);
 }
 
 static int davinci_cp_intc_host_map(struct irq_domain *h, unsigned int virq,
index fc38d2da11b93f7cc9c6830c88b0bbad671f1b7c..3b0d78aac13b35544f46a870767f6ceed0aad8a5 100644 (file)
@@ -50,7 +50,7 @@ static void __exception_irq_entry digicolor_handle_irq(struct pt_regs *regs)
                                return;
                }
 
-               handle_domain_irq(digicolor_irq_domain, hwirq, regs);
+               generic_handle_domain_irq(digicolor_irq_domain, hwirq);
        } while (1);
 }
 
index a67266e44491fa70d1cc01b8cdc3769cabce3338..d5c1c750c8d2d5a08653694798ec411cee035a3c 100644 (file)
@@ -42,7 +42,7 @@ static void __irq_entry dw_apb_ictl_handle_irq(struct pt_regs *regs)
                while (stat) {
                        u32 hwirq = ffs(stat) - 1;
 
-                       handle_domain_irq(d, hwirq, regs);
+                       generic_handle_domain_irq(d, hwirq);
                        stat &= ~BIT(hwirq);
                }
        }
index 0bf98425dca58878f3e850dd4d75daaa9817d2b5..5cc268880f8e14520b105b500c9fb409f88fcf2f 100644 (file)
@@ -134,7 +134,7 @@ asmlinkage void __exception_irq_entry ft010_irqchip_handle_irq(struct pt_regs *r
 
        while ((status = readl(FT010_IRQ_STATUS(f->base)))) {
                irq = ffs(status) - 1;
-               handle_domain_irq(f->domain, irq, regs);
+               generic_handle_domain_irq(f->domain, irq);
        }
 }
 
index fd4e9a37fea679e4a6e06de7975632462d43fedb..daec3309b014dd09e3cabba983f66b034c5ba543 100644 (file)
@@ -660,7 +660,7 @@ static inline void gic_handle_nmi(u32 irqnr, struct pt_regs *regs)
         * PSR.I will be restored when we ERET to the
         * interrupted context.
         */
-       err = handle_domain_nmi(gic_data.domain, irqnr, regs);
+       err = generic_handle_domain_nmi(gic_data.domain, irqnr);
        if (err)
                gic_deactivate_unhandled(irqnr);
 
@@ -728,7 +728,7 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs
        else
                isb();
 
-       if (handle_domain_irq(gic_data.domain, irqnr, regs)) {
+       if (generic_handle_domain_irq(gic_data.domain, irqnr)) {
                WARN_ONCE(true, "Unexpected interrupt received!\n");
                gic_deactivate_unhandled(irqnr);
        }
index 5f22c9d65e57899375f6e0efe258ed7c07182ef0..b8bb46c65a97a35747b3bc2be601ba57e73e79ed 100644 (file)
@@ -369,7 +369,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
                        this_cpu_write(sgi_intid, irqstat);
                }
 
-               handle_domain_irq(gic->domain, irqnr, regs);
+               generic_handle_domain_irq(gic->domain, irqnr);
        } while (1);
 }
 
index 058ebaebe2c40e5d0c402f8c7068a5b9cc966e11..46161f6ff289daf866404f774b50ff3ed9900a59 100644 (file)
@@ -206,7 +206,7 @@ static void __exception_irq_entry hip04_handle_irq(struct pt_regs *regs)
                irqnr = irqstat & GICC_IAR_INT_ID_MASK;
 
                if (irqnr <= HIP04_MAX_IRQS)
-                       handle_domain_irq(hip04_data.domain, irqnr, regs);
+                       generic_handle_domain_irq(hip04_data.domain, irqnr);
        } while (irqnr > HIP04_MAX_IRQS);
 }
 
index 37e0749215c70d428087f8b4fedaa320d423aeee..fb68f8c59fbb779133cf269b9a4d641f05429ef7 100644 (file)
@@ -114,7 +114,7 @@ asmlinkage void __exception_irq_entry ixp4xx_handle_irq(struct pt_regs *regs)
 
        status = __raw_readl(ixi->irqbase + IXP4XX_ICIP);
        for_each_set_bit(i, &status, 32)
-               handle_domain_irq(ixi->domain, i, regs);
+               generic_handle_domain_irq(ixi->domain, i);
 
        /*
         * IXP465/IXP435 has an upper IRQ status register
@@ -122,7 +122,7 @@ asmlinkage void __exception_irq_entry ixp4xx_handle_irq(struct pt_regs *regs)
        if (ixi->is_356) {
                status = __raw_readl(ixi->irqbase + IXP4XX_ICIP2);
                for_each_set_bit(i, &status, 32)
-                       handle_domain_irq(ixi->domain, i + 32, regs);
+                       generic_handle_domain_irq(ixi->domain, i + 32);
        }
 }
 
index 5e6f6e25f2aea6cd751f0e7113075b77a6b4f88f..a29357f394506b8b30c0d0f09fa321382c4a6b29 100644 (file)
@@ -126,7 +126,7 @@ static void __exception_irq_entry lpc32xx_handle_irq(struct pt_regs *regs)
        while (hwirq) {
                irq = __ffs(hwirq);
                hwirq &= ~BIT(irq);
-               handle_domain_irq(lpc32xx_mic_irqc->domain, irq, regs);
+               generic_handle_domain_irq(lpc32xx_mic_irqc->domain, irq);
        }
 }
 
index 4a74ac7b7c42e59aedf40b64efefb8a21d5fd32f..83455ca72439395fcb090133f4f473ed7067ab4e 100644 (file)
@@ -230,7 +230,7 @@ static void __exception_irq_entry mmp_handle_irq(struct pt_regs *regs)
        if (!(hwirq & SEL_INT_PENDING))
                return;
        hwirq &= SEL_INT_NUM_MASK;
-       handle_domain_irq(icu_data[0].domain, hwirq, regs);
+       generic_handle_domain_irq(icu_data[0].domain, hwirq);
 }
 
 static void __exception_irq_entry mmp2_handle_irq(struct pt_regs *regs)
@@ -241,7 +241,7 @@ static void __exception_irq_entry mmp2_handle_irq(struct pt_regs *regs)
        if (!(hwirq & SEL_INT_PENDING))
                return;
        hwirq &= SEL_INT_NUM_MASK;
-       handle_domain_irq(icu_data[0].domain, hwirq, regs);
+       generic_handle_domain_irq(icu_data[0].domain, hwirq);
 }
 
 /* MMP (ARMv5) */
index d1f5740cd5755cbc4858e9ff4dbd2d09e86f3eb1..55cb6b5a686e955310bfbc57ed6f5ed02e040211 100644 (file)
@@ -136,7 +136,7 @@ asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs)
 
        irqnr = __raw_readl(icoll_priv.stat);
        __raw_writel(irqnr, icoll_priv.vector);
-       handle_domain_irq(icoll_domain, irqnr, regs);
+       generic_handle_domain_irq(icoll_domain, irqnr);
 }
 
 static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq,
index b2bd96253d405b2ec55ea9e27a93a7cf4ab85b16..63bac3f78863a71d5e6fce81526ad0715185db24 100644 (file)
@@ -37,9 +37,9 @@
 
 static struct irq_domain *nvic_irq_domain;
 
-static void __nvic_handle_irq(irq_hw_number_t hwirq, struct pt_regs *regs)
+static void __nvic_handle_irq(irq_hw_number_t hwirq)
 {
-       handle_domain_irq(nvic_irq_domain, hwirq, regs);
+       generic_handle_domain_irq(nvic_irq_domain, hwirq);
 }
 
 /*
@@ -53,7 +53,7 @@ nvic_handle_irq(irq_hw_number_t hwirq, struct pt_regs *regs)
 
        irq_enter();
        old_regs = set_irq_regs(regs);
-       __nvic_handle_irq(hwirq, regs);
+       __nvic_handle_irq(hwirq);
        set_irq_regs(old_regs);
        irq_exit();
 }
index d360a6eddd6d3696805af2225893092cb77e41ec..dc82162ba7631451d485ffe9ec8c5f529923177f 100644 (file)
@@ -357,7 +357,7 @@ omap_intc_handle_irq(struct pt_regs *regs)
        }
 
        irqnr &= ACTIVEIRQ_MASK;
-       handle_domain_irq(domain, irqnr, regs);
+       generic_handle_domain_irq(domain, irqnr);
 }
 
 static int __init intc_of_init(struct device_node *node,
index 03d2366118dd4ba4672e257f87c171376b95b0b7..49b47e78764483b0eb01ed462446d43692897619 100644 (file)
@@ -116,7 +116,7 @@ static void or1k_pic_handle_irq(struct pt_regs *regs)
        int irq = -1;
 
        while ((irq = pic_get_irq(irq + 1)) != NO_IRQ)
-               handle_domain_irq(root_domain, irq, regs);
+               generic_handle_domain_irq(root_domain, irq);
 }
 
 static int or1k_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
index b6868f7b805aa2fa4540e74b44eccd51b3cbf41a..17c2c7a07f10277d49d8d73c5314ff87f48854dd 100644 (file)
@@ -42,8 +42,8 @@ __exception_irq_entry orion_handle_irq(struct pt_regs *regs)
                        gc->mask_cache;
                while (stat) {
                        u32 hwirq = __fls(stat);
-                       handle_domain_irq(orion_irq_domain,
-                                         gc->irq_base + hwirq, regs);
+                       generic_handle_domain_irq(orion_irq_domain,
+                                                 gc->irq_base + hwirq);
                        stat &= ~(1 << hwirq);
                }
        }
index 960168303b73b8ce02c6fa1ae91f879be8fafb26..9f0144a737774d8c58c08ef62e11ab6c940c45f5 100644 (file)
@@ -53,7 +53,7 @@ static void __exception_irq_entry rda_handle_irq(struct pt_regs *regs)
 
        while (stat) {
                hwirq = __fls(stat);
-               handle_domain_irq(rda_irq_domain, hwirq, regs);
+               generic_handle_domain_irq(rda_irq_domain, hwirq);
                stat &= ~BIT(hwirq);
        }
 }
index 8017f6d32d52b7453a28635a57ba3068ef184a6a..b65bd8878d4f181394a90a5d0e0a27cc760b5aba 100644 (file)
@@ -37,7 +37,7 @@ static asmlinkage void riscv_intc_irq(struct pt_regs *regs)
                break;
 #endif
        default:
-               handle_domain_irq(intc_domain, cause, regs);
+               generic_handle_domain_irq(intc_domain, cause);
                break;
        }
 }
index dbccc7dafbf8743456e60b09c0b1036691585ceb..31c202a1ae626b103acb4cbe2bb53d6f8f70ccf9 100644 (file)
@@ -140,8 +140,8 @@ sa1100_handle_irq(struct pt_regs *regs)
                if (mask == 0)
                        break;
 
-               handle_domain_irq(sa1100_normal_irqdomain,
-                               ffs(mask) - 1, regs);
+               generic_handle_domain_irq(sa1100_normal_irqdomain,
+                                         ffs(mask) - 1);
        } while (1);
 }
 
index 8a315d6a3399d599dcaf2fa7aa5c4ba06db8dba9..dd506ebfdacb5779a2554e396c76c608237201c1 100644 (file)
@@ -195,7 +195,7 @@ static void __exception_irq_entry sun4i_handle_irq(struct pt_regs *regs)
                return;
 
        do {
-               handle_domain_irq(irq_ic_data->irq_domain, hwirq, regs);
+               generic_handle_domain_irq(irq_ic_data->irq_domain, hwirq);
                hwirq = readl(irq_ic_data->irq_base +
                                SUN4I_IRQ_VECTOR_REG) >> 2;
        } while (hwirq != 0);
index 75be350cf82f8fd1a62322e4c9112ce15caf09fd..f2757b6aecc81b8f457f1e38bc2490b9d795bbd1 100644 (file)
@@ -105,7 +105,7 @@ static int handle_one_fpga(struct fpga_irq_data *f, struct pt_regs *regs)
 
        while ((status  = readl(f->base + IRQ_STATUS))) {
                irq = ffs(status) - 1;
-               handle_domain_irq(f->domain, irq, regs);
+               generic_handle_domain_irq(f->domain, irq);
                handled = 1;
        }
 
index 1e1f2d115257bf8118030e02dea0bfdf08485e1a..9e3d5561e04eae159ecf3a34108fcac7486999a4 100644 (file)
@@ -208,7 +208,7 @@ static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
 
        while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
                irq = ffs(stat) - 1;
-               handle_domain_irq(vic->domain, irq, regs);
+               generic_handle_domain_irq(vic->domain, irq);
                handled = 1;
        }
 
index 5bce936af5d9840ab1fc9ee5853b73fd93f342cc..e17dd3a8c2d5a488fedfdea55de842177c314baa 100644 (file)
@@ -183,7 +183,7 @@ static void __exception_irq_entry vt8500_handle_irq(struct pt_regs *regs)
                                continue;
                }
 
-               handle_domain_irq(intc[i].domain, irqnr, regs);
+               generic_handle_domain_irq(intc[i].domain, irqnr);
        }
 }
 
index f3ac392d5bc87fd721aeb499e23653956073acf1..0dcbeb1a05a1fe4ce4753788b0780aa178c99a90 100644 (file)
@@ -69,7 +69,7 @@ static void __exception_irq_entry wpcm450_aic_handle_irq(struct pt_regs *regs)
        /* Read IPER to signal that nIRQ can be de-asserted */
        hwirq = readl(aic->regs + AIC_IPER) / 4;
 
-       handle_domain_irq(aic->domain, hwirq, regs);
+       generic_handle_domain_irq(aic->domain, hwirq);
 }
 
 static void wpcm450_aic_eoi(struct irq_data *d)
index 84163f1ebfcfabbae818f82f369d29b0e17c820b..7a72620fc4785420bf5eaa722aa901da7ed366a2 100644 (file)
@@ -50,7 +50,7 @@ static void __exception_irq_entry zevio_handle_irq(struct pt_regs *regs)
 
        while (readl(zevio_irq_io + IO_STATUS)) {
                irqnr = readl(zevio_irq_io + IO_CURRENT);
-               handle_domain_irq(zevio_irq_domain, irqnr, regs);
+               generic_handle_domain_irq(zevio_irq_domain, irqnr);
        }
 }
 
index 59aea39785bfdb76a4fc35ff1bf3523e5452bf2a..93d270ca0c567edb5113c5380beed95082acca65 100644 (file)
@@ -168,14 +168,7 @@ int generic_handle_irq(unsigned int irq);
  * conversion failed.
  */
 int generic_handle_domain_irq(struct irq_domain *domain, unsigned int hwirq);
-
-#ifdef CONFIG_HANDLE_DOMAIN_IRQ
-int handle_domain_irq(struct irq_domain *domain,
-                     unsigned int hwirq, struct pt_regs *regs);
-
-int handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq,
-                     struct pt_regs *regs);
-#endif
+int generic_handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq);
 #endif
 
 /* Test to see if a driver has successfully requested an irq */
index 897dfc552bb061961b094ea35ca33bfad8b53ec8..1b41078222f3930d41763cc75c25bb01706af7c5 100644 (file)
@@ -97,13 +97,6 @@ config GENERIC_MSI_IRQ_DOMAIN
 config IRQ_MSI_IOMMU
        bool
 
-config HANDLE_DOMAIN_IRQ
-       bool
-
-# Legacy behaviour; architectures should call irq_{enter,exit}() themselves
-config HANDLE_DOMAIN_IRQ_IRQENTRY
-       bool
-
 config IRQ_TIMINGS
        bool
 
index 7041698a7bffc42b12e8c930a2c126582124c906..2267e6527db3c257117c227018aa3f30a7db35b6 100644 (file)
@@ -651,7 +651,11 @@ int handle_irq_desc(struct irq_desc *desc)
  * generic_handle_irq - Invoke the handler for a particular irq
  * @irq:       The irq number to handle
  *
- */
+ * Returns:    0 on success, or -EINVAL if conversion has failed
+ *
+ *             This function must be called from an IRQ context with irq regs
+ *             initialized.
+  */
 int generic_handle_irq(unsigned int irq)
 {
        return handle_irq_desc(irq_to_desc(irq));
@@ -661,77 +665,39 @@ EXPORT_SYMBOL_GPL(generic_handle_irq);
 #ifdef CONFIG_IRQ_DOMAIN
 /**
  * generic_handle_domain_irq - Invoke the handler for a HW irq belonging
- *                             to a domain, usually for a non-root interrupt
- *                             controller
+ *                             to a domain.
  * @domain:    The domain where to perform the lookup
  * @hwirq:     The HW irq number to convert to a logical one
  *
  * Returns:    0 on success, or -EINVAL if conversion has failed
  *
+ *             This function must be called from an IRQ context with irq regs
+ *             initialized.
  */
 int generic_handle_domain_irq(struct irq_domain *domain, unsigned int hwirq)
 {
+       WARN_ON_ONCE(!in_irq());
        return handle_irq_desc(irq_resolve_mapping(domain, hwirq));
 }
 EXPORT_SYMBOL_GPL(generic_handle_domain_irq);
 
-#ifdef CONFIG_HANDLE_DOMAIN_IRQ
 /**
- * handle_domain_irq - Invoke the handler for a HW irq belonging to a domain,
- *                     usually for a root interrupt controller
+ * generic_handle_domain_nmi - Invoke the handler for a HW nmi belonging
+ *                             to a domain.
  * @domain:    The domain where to perform the lookup
  * @hwirq:     The HW irq number to convert to a logical one
- * @regs:      Register file coming from the low-level handling code
- *
- *             This function must be called from an IRQ context.
  *
  * Returns:    0 on success, or -EINVAL if conversion has failed
- */
-int handle_domain_irq(struct irq_domain *domain,
-                     unsigned int hwirq, struct pt_regs *regs)
-{
-       struct pt_regs *old_regs = set_irq_regs(regs);
-       int ret;
-
-       /*
-        * IRQ context needs to be setup earlier.
-        */
-       WARN_ON(!in_irq());
-
-       ret = generic_handle_domain_irq(domain, hwirq);
-
-       set_irq_regs(old_regs);
-       return ret;
-}
-
-/**
- * handle_domain_nmi - Invoke the handler for a HW irq belonging to a domain
- * @domain:    The domain where to perform the lookup
- * @hwirq:     The HW irq number to convert to a logical one
- * @regs:      Register file coming from the low-level handling code
- *
- *             This function must be called from an NMI context.
  *
- * Returns:    0 on success, or -EINVAL if conversion has failed
- */
-int handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq,
-                     struct pt_regs *regs)
+ *             This function must be called from an NMI context with irq regs
+ *             initialized.
+ **/
+int generic_handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq)
 {
-       struct pt_regs *old_regs = set_irq_regs(regs);
-       int ret;
-
-       /*
-        * NMI context needs to be setup earlier in order to deal with tracing.
-        */
-       WARN_ON(!in_nmi());
-
-       ret = generic_handle_domain_irq(domain, hwirq);
-
-       set_irq_regs(old_regs);
-       return ret;
+       WARN_ON_ONCE(!in_nmi());
+       return handle_irq_desc(irq_resolve_mapping(domain, hwirq));
 }
 #endif
-#endif
 
 /* Dynamic interrupt handling */