LKML Archive on
help / color / mirror / Atom feed
From: "irqchip-bot for Sven Peter" <>
Cc: Sven Peter <>, Hector Martin <>,
	Marc Zyngier <>,
Subject: [irqchip: irq/irqchip-next] irqchip/apple-aic: Fix irq_disable from within irq handlers
Date: Fri, 20 Aug 2021 13:34:44 -0000	[thread overview]
Message-ID: <162946648413.25758.10370643723543390409.tip-bot2@tip-bot2> (raw)
In-Reply-To: <>

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     60a1cd10b222e004f860d14651e80089c77e8e6b
Author:        Sven Peter <>
AuthorDate:    Thu, 12 Aug 2021 12:09:42 +02:00
Committer:     Marc Zyngier <>
CommitterDate: Fri, 20 Aug 2021 14:32:33 +01:00

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: 76cde2639411 ("irqchip/apple-aic: Add support for the Apple Interrupt Controller")
Signed-off-by: Sven Peter <>
Acked-by: Hector Martin <>
Signed-off-by: Marc Zyngier <>
 drivers/irqchip/irq-apple-aic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c
index b8c06bd..6fc145a 100644
--- a/drivers/irqchip/irq-apple-aic.c
+++ b/drivers/irqchip/irq-apple-aic.c
@@ -226,7 +226,7 @@ static void aic_irq_eoi(struct irq_data *d)
 	 * Reading the interrupt reason automatically acknowledges and masks
 	 * the IRQ, so we just unmask it here if needed.
-	if (!irqd_irq_disabled(d) && !irqd_irq_masked(d))
+	if (!irqd_irq_masked(d))

      parent reply	other threads:[~2021-08-20 13:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 10:09 [PATCH] irqchip/apple-aic: fix " Sven Peter
2021-08-18 11:35 ` Hector Martin
2021-08-20 12:22 ` Marc Zyngier
2021-08-20 13:34 ` irqchip-bot for Sven Peter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=162946648413.25758.10370643723543390409.tip-bot2@tip-bot2 \ \ \ \ \ \ \
    --subject='Re: [irqchip: irq/irqchip-next] irqchip/apple-aic: Fix irq_disable from within irq handlers' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).