Skip to content

Commit 668a9fe

Browse files
author
Marc Zyngier
committed
genirq: PM: Use runtime PM for chained interrupts
When requesting an interrupt, we correctly call into the runtime PM framework to guarantee that the underlying interrupt controller is up and running. However, we fail to do so for chained interrupt controllers, as the mux interrupt is not requested along the same path. Augment __irq_do_set_handler() to call into the runtime PM code in this case, making sure the PM flow is the same for all interrupts. Reported-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Liu Ying <victor.liu@nxp.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/26973cddee5f527ea17184c0f3fccb70bc8969a0.camel@pengutronix.de
1 parent f2906aa commit 668a9fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/irq/chip.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,8 +1006,10 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
10061006
if (desc->irq_data.chip != &no_irq_chip)
10071007
mask_ack_irq(desc);
10081008
irq_state_set_disabled(desc);
1009-
if (is_chained)
1009+
if (is_chained) {
10101010
desc->action = NULL;
1011+
WARN_ON(irq_chip_pm_put(irq_desc_get_irq_data(desc)));
1012+
}
10111013
desc->depth = 1;
10121014
}
10131015
desc->handle_irq = handle;
@@ -1033,6 +1035,7 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
10331035
irq_settings_set_norequest(desc);
10341036
irq_settings_set_nothread(desc);
10351037
desc->action = &chained_action;
1038+
WARN_ON(irq_chip_pm_get(irq_desc_get_irq_data(desc)));
10361039
irq_activate_and_startup(desc, IRQ_RESEND);
10371040
}
10381041
}

0 commit comments

Comments
 (0)