public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.4 1/7] genirq: PM: Use runtime PM for chained interrupts
@ 2022-06-21 20:51 Sasha Levin
  2022-06-21 20:51 ` [PATCH AUTOSEL 5.4 2/7] irqchip/uniphier-aidet: Add compatible string for NX1 SoC Sasha Levin
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sasha Levin @ 2022-06-21 20:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Marc Zyngier, Lucas Stach, Liu Ying, Sasha Levin, tglx

From: Marc Zyngier <maz@kernel.org>

[ Upstream commit 668a9fe5c6a1bcac6b65d5e9b91a9eca86f782a3 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/irq/chip.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 856f0297dc73..7a7abd6859cd 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -1022,8 +1022,10 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
 		if (desc->irq_data.chip != &no_irq_chip)
 			mask_ack_irq(desc);
 		irq_state_set_disabled(desc);
-		if (is_chained)
+		if (is_chained) {
 			desc->action = NULL;
+			WARN_ON(irq_chip_pm_put(irq_desc_get_irq_data(desc)));
+		}
 		desc->depth = 1;
 	}
 	desc->handle_irq = handle;
@@ -1049,6 +1051,7 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
 		irq_settings_set_norequest(desc);
 		irq_settings_set_nothread(desc);
 		desc->action = &chained_action;
+		WARN_ON(irq_chip_pm_get(irq_desc_get_irq_data(desc)));
 		irq_activate_and_startup(desc, IRQ_RESEND);
 	}
 }
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-21 21:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-21 20:51 [PATCH AUTOSEL 5.4 1/7] genirq: PM: Use runtime PM for chained interrupts Sasha Levin
2022-06-21 20:51 ` [PATCH AUTOSEL 5.4 2/7] irqchip/uniphier-aidet: Add compatible string for NX1 SoC Sasha Levin
2022-06-21 20:51 ` [PATCH AUTOSEL 5.4 3/7] mei: me: set internal pg flag to off on hardware reset Sasha Levin
2022-06-21 20:51 ` [PATCH AUTOSEL 5.4 4/7] nvme-pci: add trouble shooting steps for timeouts Sasha Levin
2022-06-21 20:51 ` [PATCH AUTOSEL 5.4 5/7] ext4: improve write performance with disabled delalloc Sasha Levin
2022-06-21 20:51 ` [PATCH AUTOSEL 5.4 6/7] blk-mq: protect q->elevator by ->sysfs_lock in blk_mq_elv_switch_none Sasha Levin
2022-06-21 20:51 ` [PATCH AUTOSEL 5.4 7/7] ext4: correct the judgment of BUG in ext4_mb_normalize_request Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox