Skip to content

Commit 486562d

Browse files
mans0nMarc Zyngier
authored andcommitted
irqchip/versatile-fpga: Handle chained IRQs properly
Enclose the chained handler with chained_irq_{enter,exit}(), so that the muxed interrupts get properly acked. This patch also fixes a reboot bug on OX820 SoC, where the jiffies timer interrupt is never acked. The kernel waits a clock tick forever in calibrate_delay_converge(), which leads to a boot hang. Fixes: c41b16f ("ARM: integrator/versatile: consolidate FPGA IRQ handling code") Signed-off-by: Sungbo Eo <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7809f70 commit 486562d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/irqchip/irq-versatile-fpga.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/irq.h>
77
#include <linux/io.h>
88
#include <linux/irqchip.h>
9+
#include <linux/irqchip/chained_irq.h>
910
#include <linux/irqchip/versatile-fpga.h>
1011
#include <linux/irqdomain.h>
1112
#include <linux/module.h>
@@ -68,12 +69,16 @@ static void fpga_irq_unmask(struct irq_data *d)
6869

6970
static void fpga_irq_handle(struct irq_desc *desc)
7071
{
72+
struct irq_chip *chip = irq_desc_get_chip(desc);
7173
struct fpga_irq_data *f = irq_desc_get_handler_data(desc);
72-
u32 status = readl(f->base + IRQ_STATUS);
74+
u32 status;
75+
76+
chained_irq_enter(chip, desc);
7377

78+
status = readl(f->base + IRQ_STATUS);
7479
if (status == 0) {
7580
do_bad_IRQ(desc);
76-
return;
81+
goto out;
7782
}
7883

7984
do {
@@ -82,6 +87,9 @@ static void fpga_irq_handle(struct irq_desc *desc)
8287
status &= ~(1 << irq);
8388
generic_handle_irq(irq_find_mapping(f->domain, irq));
8489
} while (status);
90+
91+
out:
92+
chained_irq_exit(chip, desc);
8593
}
8694

8795
/*

0 commit comments

Comments
 (0)