Commit 1e12c4a9 authored by Marc Zyngier's avatar Marc Zyngier

genirq: Correctly configure the trigger on chained interrupts

Commit 1e2a7d78 ("irqdomain: Don't set type when mapping an IRQ")
moved the trigger configuration call from the irqdomain mapping to
the interrupt being actually requested.

This patch failed to handle the case where we configure a chained
interrupt, which doesn't get requested through the usual path.

In order to solve this, let's call __irq_set_trigger just before
starting the cascade interrupt. Special care must be taken to
make the flow handler stick, as the .irq_set_type method could
have reset it (it doesn't know we're dealing with a chained

Based on an initial patch by Jon Hunter.

Fixes: 1e2a7d78 ("irqdomain: Don't set type when mapping an IRQ")
Reported-by: default avatarJohn Stultz <>
Reported-by: default avatarLinus Walleij <>
Tested-by: default avatarJohn Stultz <>
Acked-by: default avatarJon Hunter <>
Signed-off-by: default avatarMarc Zyngier <>
parent 694d0d0b
......@@ -820,6 +820,17 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
desc->name = name;
if (handle != handle_bad_irq && is_chained) {
* We're about to start this interrupt immediately,
* hence the need to set the trigger configuration.
* But the .set_type callback may have overridden the
* flow handler, ignoring that we're dealing with a
* chained interrupt. Reset it immediately because we
* do know better.
__irq_set_trigger(desc, irqd_get_trigger_type(&desc->irq_data));
desc->handle_irq = handle;
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