Commit 0661cb2a authored by Marc Zyngier's avatar Marc Zyngier

mips: Bulk conversion to generic_handle_domain_irq()

Wherever possible, replace constructs that match either
generic_handle_irq(irq_find_mapping()) or
generic_handle_irq(irq_linear_revmap()) to a single call to
generic_handle_domain_irq().
Acked-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent c9604ddd
...@@ -69,24 +69,24 @@ static void ar2315_misc_irq_handler(struct irq_desc *desc) ...@@ -69,24 +69,24 @@ static void ar2315_misc_irq_handler(struct irq_desc *desc)
{ {
u32 pending = ar2315_rst_reg_read(AR2315_ISR) & u32 pending = ar2315_rst_reg_read(AR2315_ISR) &
ar2315_rst_reg_read(AR2315_IMR); ar2315_rst_reg_read(AR2315_IMR);
unsigned nr, misc_irq = 0; unsigned nr;
int ret = 0;
if (pending) { if (pending) {
struct irq_domain *domain = irq_desc_get_handler_data(desc); struct irq_domain *domain = irq_desc_get_handler_data(desc);
nr = __ffs(pending); nr = __ffs(pending);
misc_irq = irq_find_mapping(domain, nr);
}
if (misc_irq) {
if (nr == AR2315_MISC_IRQ_GPIO) if (nr == AR2315_MISC_IRQ_GPIO)
ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_GPIO); ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_GPIO);
else if (nr == AR2315_MISC_IRQ_WATCHDOG) else if (nr == AR2315_MISC_IRQ_WATCHDOG)
ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_WD); ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_WD);
generic_handle_irq(misc_irq);
} else { ret = generic_handle_domain_irq(domain, nr);
spurious_interrupt();
} }
if (!pending || ret)
spurious_interrupt();
} }
static void ar2315_misc_irq_unmask(struct irq_data *d) static void ar2315_misc_irq_unmask(struct irq_data *d)
......
...@@ -73,22 +73,21 @@ static void ar5312_misc_irq_handler(struct irq_desc *desc) ...@@ -73,22 +73,21 @@ static void ar5312_misc_irq_handler(struct irq_desc *desc)
{ {
u32 pending = ar5312_rst_reg_read(AR5312_ISR) & u32 pending = ar5312_rst_reg_read(AR5312_ISR) &
ar5312_rst_reg_read(AR5312_IMR); ar5312_rst_reg_read(AR5312_IMR);
unsigned nr, misc_irq = 0; unsigned nr;
int ret = 0;
if (pending) { if (pending) {
struct irq_domain *domain = irq_desc_get_handler_data(desc); struct irq_domain *domain = irq_desc_get_handler_data(desc);
nr = __ffs(pending); nr = __ffs(pending);
misc_irq = irq_find_mapping(domain, nr);
}
if (misc_irq) { ret = generic_handle_domain_irq(domain, nr);
generic_handle_irq(misc_irq);
if (nr == AR5312_MISC_IRQ_TIMER) if (nr == AR5312_MISC_IRQ_TIMER)
ar5312_rst_reg_read(AR5312_TIMER); ar5312_rst_reg_read(AR5312_TIMER);
} else {
spurious_interrupt();
} }
if (!pending || ret)
spurious_interrupt();
} }
/* Enable the specified AR5312_MISC_IRQ interrupt */ /* Enable the specified AR5312_MISC_IRQ interrupt */
......
...@@ -300,7 +300,7 @@ static void ltq_hw_irq_handler(struct irq_desc *desc) ...@@ -300,7 +300,7 @@ static void ltq_hw_irq_handler(struct irq_desc *desc)
*/ */
irq = __fls(irq); irq = __fls(irq);
hwirq = irq + MIPS_CPU_IRQ_CASCADE + (INT_NUM_IM_OFFSET * module); hwirq = irq + MIPS_CPU_IRQ_CASCADE + (INT_NUM_IM_OFFSET * module);
generic_handle_irq(irq_linear_revmap(ltq_domain, hwirq)); generic_handle_domain_irq(ltq_domain, hwirq);
/* if this is a EBU irq, we need to ack it or get a deadlock */ /* if this is a EBU irq, we need to ack it or get a deadlock */
if (irq == LTQ_ICU_EBU_IRQ && !module && LTQ_EBU_PCC_ISTAT != 0) if (irq == LTQ_ICU_EBU_IRQ && !module && LTQ_EBU_PCC_ISTAT != 0)
......
...@@ -337,14 +337,12 @@ static void ar2315_pci_irq_handler(struct irq_desc *desc) ...@@ -337,14 +337,12 @@ static void ar2315_pci_irq_handler(struct irq_desc *desc)
struct ar2315_pci_ctrl *apc = irq_desc_get_handler_data(desc); struct ar2315_pci_ctrl *apc = irq_desc_get_handler_data(desc);
u32 pending = ar2315_pci_reg_read(apc, AR2315_PCI_ISR) & u32 pending = ar2315_pci_reg_read(apc, AR2315_PCI_ISR) &
ar2315_pci_reg_read(apc, AR2315_PCI_IMR); ar2315_pci_reg_read(apc, AR2315_PCI_IMR);
unsigned pci_irq = 0; int ret = 0;
if (pending) if (pending)
pci_irq = irq_find_mapping(apc->domain, __ffs(pending)); ret = generic_handle_domain_irq(apc->domain, __ffs(pending));
if (pci_irq) if (!pending || ret)
generic_handle_irq(pci_irq);
else
spurious_interrupt(); spurious_interrupt();
} }
......
...@@ -140,10 +140,9 @@ static void rt3883_pci_irq_handler(struct irq_desc *desc) ...@@ -140,10 +140,9 @@ static void rt3883_pci_irq_handler(struct irq_desc *desc)
} }
while (pending) { while (pending) {
unsigned irq, bit = __ffs(pending); unsigned bit = __ffs(pending);
irq = irq_find_mapping(rpc->irq_domain, bit); generic_handle_domain_irq(rpc->irq_domain, bit);
generic_handle_irq(irq);
pending &= ~BIT(bit); pending &= ~BIT(bit);
} }
......
...@@ -100,7 +100,7 @@ static void ralink_intc_irq_handler(struct irq_desc *desc) ...@@ -100,7 +100,7 @@ static void ralink_intc_irq_handler(struct irq_desc *desc)
if (pending) { if (pending) {
struct irq_domain *domain = irq_desc_get_handler_data(desc); struct irq_domain *domain = irq_desc_get_handler_data(desc);
generic_handle_irq(irq_find_mapping(domain, __ffs(pending))); generic_handle_domain_irq(domain, __ffs(pending));
} else { } else {
spurious_interrupt(); spurious_interrupt();
} }
......
...@@ -190,7 +190,7 @@ static void ip27_do_irq_mask0(struct irq_desc *desc) ...@@ -190,7 +190,7 @@ static void ip27_do_irq_mask0(struct irq_desc *desc)
unsigned long *mask = per_cpu(irq_enable_mask, cpu); unsigned long *mask = per_cpu(irq_enable_mask, cpu);
struct irq_domain *domain; struct irq_domain *domain;
u64 pend0; u64 pend0;
int irq; int ret;
/* copied from Irix intpend0() */ /* copied from Irix intpend0() */
pend0 = LOCAL_HUB_L(PI_INT_PEND0); pend0 = LOCAL_HUB_L(PI_INT_PEND0);
...@@ -216,10 +216,8 @@ static void ip27_do_irq_mask0(struct irq_desc *desc) ...@@ -216,10 +216,8 @@ static void ip27_do_irq_mask0(struct irq_desc *desc)
#endif #endif
{ {
domain = irq_desc_get_handler_data(desc); domain = irq_desc_get_handler_data(desc);
irq = irq_linear_revmap(domain, __ffs(pend0)); ret = generic_handle_domain_irq(domain, __ffs(pend0));
if (irq) if (ret)
generic_handle_irq(irq);
else
spurious_interrupt(); spurious_interrupt();
} }
...@@ -232,7 +230,7 @@ static void ip27_do_irq_mask1(struct irq_desc *desc) ...@@ -232,7 +230,7 @@ static void ip27_do_irq_mask1(struct irq_desc *desc)
unsigned long *mask = per_cpu(irq_enable_mask, cpu); unsigned long *mask = per_cpu(irq_enable_mask, cpu);
struct irq_domain *domain; struct irq_domain *domain;
u64 pend1; u64 pend1;
int irq; int ret;
/* copied from Irix intpend0() */ /* copied from Irix intpend0() */
pend1 = LOCAL_HUB_L(PI_INT_PEND1); pend1 = LOCAL_HUB_L(PI_INT_PEND1);
...@@ -242,10 +240,8 @@ static void ip27_do_irq_mask1(struct irq_desc *desc) ...@@ -242,10 +240,8 @@ static void ip27_do_irq_mask1(struct irq_desc *desc)
return; return;
domain = irq_desc_get_handler_data(desc); domain = irq_desc_get_handler_data(desc);
irq = irq_linear_revmap(domain, __ffs(pend1) + 64); ret = generic_handle_domain_irq(domain, __ffs(pend1) + 64);
if (irq) if (ret)
generic_handle_irq(irq);
else
spurious_interrupt(); spurious_interrupt();
LOCAL_HUB_L(PI_INT_PEND1); LOCAL_HUB_L(PI_INT_PEND1);
......
...@@ -99,7 +99,7 @@ static void ip30_normal_irq(struct irq_desc *desc) ...@@ -99,7 +99,7 @@ static void ip30_normal_irq(struct irq_desc *desc)
int cpu = smp_processor_id(); int cpu = smp_processor_id();
struct irq_domain *domain; struct irq_domain *domain;
u64 pend, mask; u64 pend, mask;
int irq; int ret;
pend = heart_read(&heart_regs->isr); pend = heart_read(&heart_regs->isr);
mask = (heart_read(&heart_regs->imr[cpu]) & mask = (heart_read(&heart_regs->imr[cpu]) &
...@@ -130,10 +130,8 @@ static void ip30_normal_irq(struct irq_desc *desc) ...@@ -130,10 +130,8 @@ static void ip30_normal_irq(struct irq_desc *desc)
#endif #endif
{ {
domain = irq_desc_get_handler_data(desc); domain = irq_desc_get_handler_data(desc);
irq = irq_linear_revmap(domain, __ffs(pend)); ret = generic_handle_domain_irq(domain, __ffs(pend));
if (irq) if (ret)
generic_handle_irq(irq);
else
spurious_interrupt(); spurious_interrupt();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment