]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip/exiu: Fix acknowledgment of edge triggered interrupts
authorDaniel Thompson <daniel.thompson@linaro.org>
Tue, 3 May 2022 13:45:41 +0000 (14:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:54 +0000 (10:22 +0200)
commita5cfff1d4afaf78bc5c94b4262e290816864e0aa
treea8522ca33ae898e765cafde5010e6c882b741cab
parent5e1256deb141d504432c0bcf40cd813805cc9a3a
irqchip/exiu: Fix acknowledgment of edge triggered interrupts

[ Upstream commit dcf648a04eeb46f551f3c9c6fb89ce60248183a6 ]

Currently the EXIU uses the fasteoi interrupt flow that is configured by
it's parent (irq-gic-v3.c). With this flow the only chance to clear the
interrupt request happens during .irq_eoi() and (obviously) this happens
after the interrupt handler has run. EXIU requires edge triggered
interrupts to be acked prior to interrupt handling. Without this we
risk incorrect interrupt dismissal when a new interrupt is delivered
after the handler reads and acknowledges the peripheral but before the
irq_eoi() takes place.

Fix this by clearing the interrupt request from .irq_ack() if we are
configured for edge triggered interrupts. This requires adopting the
fasteoi-ack flow instead of the fasteoi to ensure the ack gets called.

These changes have been tested using the power button on a
Developerbox/SC2A11 combined with some hackery in gpio-keys so I can
play with the different trigger mode [and an mdelay(500) so I can
can check what happens on a double click in both modes].

Fixes: cb3b3c928117 ("irqchip/exiu: Add support for Socionext Synquacer EXIU controller")
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220503134541.2566457-1-daniel.thompson@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/Kconfig.platforms
drivers/irqchip/irq-sni-exiu.c