Skip to content

Commit 0661cb2

Browse files
author
Marc Zyngier
committed
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: Thomas Bogendoerfer <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent c9604dd commit 0661cb2

File tree

8 files changed

+29
-39
lines changed

8 files changed

+29
-39
lines changed

arch/mips/ath25/ar2315.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,24 @@ static void ar2315_misc_irq_handler(struct irq_desc *desc)
6969
{
7070
u32 pending = ar2315_rst_reg_read(AR2315_ISR) &
7171
ar2315_rst_reg_read(AR2315_IMR);
72-
unsigned nr, misc_irq = 0;
72+
unsigned nr;
73+
int ret = 0;
7374

7475
if (pending) {
7576
struct irq_domain *domain = irq_desc_get_handler_data(desc);
7677

7778
nr = __ffs(pending);
78-
misc_irq = irq_find_mapping(domain, nr);
79-
}
8079

81-
if (misc_irq) {
8280
if (nr == AR2315_MISC_IRQ_GPIO)
8381
ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_GPIO);
8482
else if (nr == AR2315_MISC_IRQ_WATCHDOG)
8583
ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_WD);
86-
generic_handle_irq(misc_irq);
87-
} else {
88-
spurious_interrupt();
84+
85+
ret = generic_handle_domain_irq(domain, nr);
8986
}
87+
88+
if (!pending || ret)
89+
spurious_interrupt();
9090
}
9191

9292
static void ar2315_misc_irq_unmask(struct irq_data *d)

arch/mips/ath25/ar5312.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,21 @@ static void ar5312_misc_irq_handler(struct irq_desc *desc)
7373
{
7474
u32 pending = ar5312_rst_reg_read(AR5312_ISR) &
7575
ar5312_rst_reg_read(AR5312_IMR);
76-
unsigned nr, misc_irq = 0;
76+
unsigned nr;
77+
int ret = 0;
7778

7879
if (pending) {
7980
struct irq_domain *domain = irq_desc_get_handler_data(desc);
8081

8182
nr = __ffs(pending);
82-
misc_irq = irq_find_mapping(domain, nr);
83-
}
8483

85-
if (misc_irq) {
86-
generic_handle_irq(misc_irq);
84+
ret = generic_handle_domain_irq(domain, nr);
8785
if (nr == AR5312_MISC_IRQ_TIMER)
8886
ar5312_rst_reg_read(AR5312_TIMER);
89-
} else {
90-
spurious_interrupt();
9187
}
88+
89+
if (!pending || ret)
90+
spurious_interrupt();
9291
}
9392

9493
/* Enable the specified AR5312_MISC_IRQ interrupt */

arch/mips/lantiq/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static void ltq_hw_irq_handler(struct irq_desc *desc)
300300
*/
301301
irq = __fls(irq);
302302
hwirq = irq + MIPS_CPU_IRQ_CASCADE + (INT_NUM_IM_OFFSET * module);
303-
generic_handle_irq(irq_linear_revmap(ltq_domain, hwirq));
303+
generic_handle_domain_irq(ltq_domain, hwirq);
304304

305305
/* if this is a EBU irq, we need to ack it or get a deadlock */
306306
if (irq == LTQ_ICU_EBU_IRQ && !module && LTQ_EBU_PCC_ISTAT != 0)

arch/mips/pci/pci-ar2315.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,12 @@ static void ar2315_pci_irq_handler(struct irq_desc *desc)
337337
struct ar2315_pci_ctrl *apc = irq_desc_get_handler_data(desc);
338338
u32 pending = ar2315_pci_reg_read(apc, AR2315_PCI_ISR) &
339339
ar2315_pci_reg_read(apc, AR2315_PCI_IMR);
340-
unsigned pci_irq = 0;
340+
int ret = 0;
341341

342342
if (pending)
343-
pci_irq = irq_find_mapping(apc->domain, __ffs(pending));
343+
ret = generic_handle_domain_irq(apc->domain, __ffs(pending));
344344

345-
if (pci_irq)
346-
generic_handle_irq(pci_irq);
347-
else
345+
if (!pending || ret)
348346
spurious_interrupt();
349347
}
350348

arch/mips/pci/pci-rt3883.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,9 @@ static void rt3883_pci_irq_handler(struct irq_desc *desc)
140140
}
141141

142142
while (pending) {
143-
unsigned irq, bit = __ffs(pending);
143+
unsigned bit = __ffs(pending);
144144

145-
irq = irq_find_mapping(rpc->irq_domain, bit);
146-
generic_handle_irq(irq);
145+
generic_handle_domain_irq(rpc->irq_domain, bit);
147146

148147
pending &= ~BIT(bit);
149148
}

arch/mips/ralink/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static void ralink_intc_irq_handler(struct irq_desc *desc)
100100

101101
if (pending) {
102102
struct irq_domain *domain = irq_desc_get_handler_data(desc);
103-
generic_handle_irq(irq_find_mapping(domain, __ffs(pending)));
103+
generic_handle_domain_irq(domain, __ffs(pending));
104104
} else {
105105
spurious_interrupt();
106106
}

arch/mips/sgi-ip27/ip27-irq.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static void ip27_do_irq_mask0(struct irq_desc *desc)
190190
unsigned long *mask = per_cpu(irq_enable_mask, cpu);
191191
struct irq_domain *domain;
192192
u64 pend0;
193-
int irq;
193+
int ret;
194194

195195
/* copied from Irix intpend0() */
196196
pend0 = LOCAL_HUB_L(PI_INT_PEND0);
@@ -216,10 +216,8 @@ static void ip27_do_irq_mask0(struct irq_desc *desc)
216216
#endif
217217
{
218218
domain = irq_desc_get_handler_data(desc);
219-
irq = irq_linear_revmap(domain, __ffs(pend0));
220-
if (irq)
221-
generic_handle_irq(irq);
222-
else
219+
ret = generic_handle_domain_irq(domain, __ffs(pend0));
220+
if (ret)
223221
spurious_interrupt();
224222
}
225223

@@ -232,7 +230,7 @@ static void ip27_do_irq_mask1(struct irq_desc *desc)
232230
unsigned long *mask = per_cpu(irq_enable_mask, cpu);
233231
struct irq_domain *domain;
234232
u64 pend1;
235-
int irq;
233+
int ret;
236234

237235
/* copied from Irix intpend0() */
238236
pend1 = LOCAL_HUB_L(PI_INT_PEND1);
@@ -242,10 +240,8 @@ static void ip27_do_irq_mask1(struct irq_desc *desc)
242240
return;
243241

244242
domain = irq_desc_get_handler_data(desc);
245-
irq = irq_linear_revmap(domain, __ffs(pend1) + 64);
246-
if (irq)
247-
generic_handle_irq(irq);
248-
else
243+
ret = generic_handle_domain_irq(domain, __ffs(pend1) + 64);
244+
if (ret)
249245
spurious_interrupt();
250246

251247
LOCAL_HUB_L(PI_INT_PEND1);

arch/mips/sgi-ip30/ip30-irq.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void ip30_normal_irq(struct irq_desc *desc)
9999
int cpu = smp_processor_id();
100100
struct irq_domain *domain;
101101
u64 pend, mask;
102-
int irq;
102+
int ret;
103103

104104
pend = heart_read(&heart_regs->isr);
105105
mask = (heart_read(&heart_regs->imr[cpu]) &
@@ -130,10 +130,8 @@ static void ip30_normal_irq(struct irq_desc *desc)
130130
#endif
131131
{
132132
domain = irq_desc_get_handler_data(desc);
133-
irq = irq_linear_revmap(domain, __ffs(pend));
134-
if (irq)
135-
generic_handle_irq(irq);
136-
else
133+
ret = generic_handle_domain_irq(domain, __ffs(pend));
134+
if (ret)
137135
spurious_interrupt();
138136
}
139137
}

0 commit comments

Comments
 (0)