Skip to content

Commit 1e12c4a

Browse files
author
Marc Zyngier
committed
genirq: Correctly configure the trigger on chained interrupts
Commit 1e2a7d7 ("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 interrupt). Based on an initial patch by Jon Hunter. Fixes: 1e2a7d7 ("irqdomain: Don't set type when mapping an IRQ") Reported-by: John Stultz <john.stultz@linaro.org> Reported-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: John Stultz <john.stultz@linaro.org> Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 694d0d0 commit 1e12c4a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

kernel/irq/chip.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,17 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
820820
desc->name = name;
821821

822822
if (handle != handle_bad_irq && is_chained) {
823+
/*
824+
* We're about to start this interrupt immediately,
825+
* hence the need to set the trigger configuration.
826+
* But the .set_type callback may have overridden the
827+
* flow handler, ignoring that we're dealing with a
828+
* chained interrupt. Reset it immediately because we
829+
* do know better.
830+
*/
831+
__irq_set_trigger(desc, irqd_get_trigger_type(&desc->irq_data));
832+
desc->handle_irq = handle;
833+
823834
irq_settings_set_noprobe(desc);
824835
irq_settings_set_norequest(desc);
825836
irq_settings_set_nothread(desc);

0 commit comments

Comments
 (0)