Skip to content

Commit 60a1cd1

Browse files
svenpeter42Marc Zyngier
authored andcommitted
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: 76cde26 ("irqchip/apple-aic: Add support for the Apple Interrupt Controller") Signed-off-by: Sven Peter <[email protected]> Acked-by: Hector Martin <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c775626 commit 60a1cd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/irqchip/irq-apple-aic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static void aic_irq_eoi(struct irq_data *d)
226226
* Reading the interrupt reason automatically acknowledges and masks
227227
* the IRQ, so we just unmask it here if needed.
228228
*/
229-
if (!irqd_irq_disabled(d) && !irqd_irq_masked(d))
229+
if (!irqd_irq_masked(d))
230230
aic_irq_unmask(d);
231231
}
232232

0 commit comments

Comments
 (0)