Skip to content

Commit 6a214a2

Browse files
mans0nMarc Zyngier
authored andcommitted
irqchip/versatile-fpga: Apply clear-mask earlier
Clear its own IRQs before the parent IRQ get enabled, so that the remaining IRQs do not accidentally interrupt the parent IRQ controller. This patch also fixes a reboot bug on OX820 SoC, where the remaining rps-timer IRQ raises a GIC interrupt that is left pending. After that, the rps-timer IRQ is cleared during driver initialization, and there's no IRQ left in rps-irq when local_irq_enable() is called, which evokes an error message "unexpected IRQ trap". Fixes: bdd272c ("irqchip: versatile FPGA: support cascaded interrupts from DT") Signed-off-by: Sungbo Eo <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent b2cb11f commit 6a214a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/irqchip/irq-versatile-fpga.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ int __init fpga_irq_of_init(struct device_node *node,
212212
if (of_property_read_u32(node, "valid-mask", &valid_mask))
213213
valid_mask = 0;
214214

215+
writel(clear_mask, base + IRQ_ENABLE_CLEAR);
216+
writel(clear_mask, base + FIQ_ENABLE_CLEAR);
217+
215218
/* Some chips are cascaded from a parent IRQ */
216219
parent_irq = irq_of_parse_and_map(node, 0);
217220
if (!parent_irq) {
@@ -221,9 +224,6 @@ int __init fpga_irq_of_init(struct device_node *node,
221224

222225
fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node);
223226

224-
writel(clear_mask, base + IRQ_ENABLE_CLEAR);
225-
writel(clear_mask, base + FIQ_ENABLE_CLEAR);
226-
227227
/*
228228
* On Versatile AB/PB, some secondary interrupts have a direct
229229
* pass-thru to the primary controller for IRQs 20 and 22-31 which need

0 commit comments

Comments
 (0)