]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip/apple-aic: Fix irq_disable from within irq handlers
authorSven Peter <sven@svenpeter.dev>
Thu, 12 Aug 2021 10:09:42 +0000 (12:09 +0200)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Aug 2021 13:32:33 +0000 (14:32 +0100)
commitabacfe25794191eee24de17794f8f9f2cda843fc
tree4cfcc6601307e9c9c92433bd2c661298c1165210
parent7447ffc77d202a97db9e1628ca011dc9e462a2e1
irqchip/apple-aic: Fix irq_disable from within irq handlers

When disable_irq_nosync for an interrupt is called from within its
interrupt handler, this interrupt is only marked as disabled with the
intention to mask it when it triggers again.
The AIC hardware however automatically masks the interrupt when it is read.
aic_irq_eoi then unmasks it again if it's not disabled *and* not masked.
This results in a state mismatch between the hardware state and the
state kept in irq_data: The hardware interrupt is masked but
IRQD_IRQ_MASKED is not set. Any further calls to unmask_irq will directly
return and the interrupt can never be enabled again.

Fix this by keeping the hardware and irq_data state in sync by unmasking in
aic_irq_eoi if and only if the irq_data state also assumes the interrupt to
be unmasked.

Fixes: 5b0f79c8065f ("irqchip/apple-aic: Add support for the Apple Interrupt Controller")
Signed-off-by: Sven Peter <sven@svenpeter.dev>
Acked-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210812100942.17206-1-sven@svenpeter.dev
drivers/irqchip/irq-apple-aic.c