Irq_ack_irq_eoi
irq_ack vs. irq_eoi: Why “Acknowledge” and “End of Interrupt” Are Not the Same Thing
A 2022 patch for the Socionext EXIU interrupt controller carried a subject line that should give any interrupt-subsystem reader pause: “irqchip/exiu: Fix acknowledgment of edge triggered interrupts.” The problem was not that EXIU lacked an acknowledge step. The problem was that the Linux interrupt framework was invoking irq_eoi()—end of interrupt—where the hardware required an acknowledgment to happen before the handler ran. The fix moved the relevant register write from irq_eoi into irq_ack, and in doing so switched the flow handler from handle_fasteoi_irq to handle_fasteoi_ack_irq.
That patch is a useful entry point into a distinction that is easy to miss when both callbacks look like “tell the controller something” operations. irq_ack and irq_eoi occupy different positions in the interrupt lifecycle, and conflating them can produce silent interrupt loss on edge-triggered hardware.
The header already encodes the split
The kernel header describes the two callbacks with deliberate asymmetry:
@irq_ack: start of a new interrupt@irq_eoi: end of interrupt[reference:1]
Those comments are not decorative. They encode a temporal split. irq_ack is expected at the front of interrupt delivery—when the controller hands the interrupt to the CPU, or shortly before the handler runs. irq_eoi is expected at the back—after the handler has finished servicing the device.
“Ack” claims the request; “EOI” retires the handling
On controllers that expose acknowledgment as a distinct step, irq_ack tells the controller “this specific interrupt has been taken.” It retires the request and prevents the same interrupt from being re-presented as pending while it is being serviced. irq_eoi, by contrast, tells the controller “the processor has finished with this interrupt.” It retires the handling and allows the controller to lower priority and move on.
Benjamin Herrenschmidt drew the line explicitly on LKML in 2006, in the context of controllers where acknowledgment happens implicitly when the vector is fetched:
“1) [these controllers] will have 1) already acke’d the interrupt by the time you get the vector (the act of getting the vector does the ack) … 3) all we need is to do an ‘EOI’ (end of interrupt) at the end of the handling”[reference:2].
The acknowledgment is tied to obtaining the interrupt; the EOI is tied to finishing it.
GIC makes the ordering mechanical
The ARM GIC architecture specification turns this semantic distinction into a state-machine rule. A read of ICC_IAR{0,1}_EL1 acts as the acknowledge: it returns the interrupt ID and moves the interrupt from pending to active. A write to ICC_EOIR{0,1}_EL1 deactivates the interrupt. The rule is strict:
“An interrupt can only be deactivated (with or without prior priority drop) if it has been acknowledged first. In GIC speak, this means that only the following sequences are valid: … x = ICC_IAR{0,1}_EL1; ICC_EOIR{0,1}_EL1 = x”[reference:3].
A write to EOIR that does not correspond to a prior read from IAR breaks the state machine and produces unpredictable results, potentially affecting all interrupts in the system[reference:4]. The hardware will not let you EOI what you have not first acknowledged.
Why edge-triggered interrupts expose the difference
On many level-triggered designs, the distinction can remain invisible in software. The controller may acknowledge implicitly when it delivers the vector, and handle_fasteoi_irq may never call irq_ack at all; the only software-visible step is the EOI at the end.
For edge-triggered interrupts, deferring acknowledgment until EOI can be fatally late. The EXIU patch describes the failure mode directly:
“Currently the EXIU uses the fasteoi interrupt flow … 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 theirq_eoi()takes place”[reference:5].
In other words, irq_eoi answers the question “has the processor finished?” For edge-triggered hardware, that is not the question the controller needs answered at the point of delivery. The controller needs to know “has this edge been claimed?”—and claiming is acknowledgment, not EOI.
The two fasteoi flows
The kernel provides two fasteoi variants, and their names encode the distinction:
handle_fasteoi_irqis the conventional flow: the controller is expected to have handled acknowledgment implicitly, and software callsirq_eoi()after the handler.handle_fasteoi_ack_irqis “for use with hierarchy where the irq_chip also needs to have its->irq_ack()function called”. In this flow,irq_ack()is invoked before servicing the interrupt, andirq_eoi()afterward.
EXIU is a concrete instance of the second case. Before the fix, the driver implemented everything in exiu_irq_eoi. After the fix, it gains an exiu_irq_ack that writes to the request-clear register, and the flow is selected dynamically: level-triggered interrupts retain handle_fasteoi_irq, while edge-triggered interrupts switch to handle_fasteoi_ack_irq so that acknowledgment happens before the handler.
A necessary caveat: acknowledgment is sometimes implicit
irq_ack is not universally present or universally called. On controllers where acknowledgment happens as a side effect of reading the interrupt vector—such as the GIC’s IAR read—there may be no distinct software step to perform, and the flow handler may never invoke irq_ack. That is why the callback is optional in struct irq_chip. The existence of implicit acknowledgment does not collapse the distinction. It means the mechanism differs across controllers, but the semantics remain: something must claim the interrupt before handling, and something must declare the handling finished afterward. On a controller where claiming is explicit, irq_ack is the hook that makes it possible; handle_fasteoi_ack_irq is the flow that guarantees it runs at the right time.
Takeaway
irq_ack and irq_eoi bracket the interrupt handler from opposite ends. Acknowledgment claims the interrupt for servicing; EOI declares the servicing complete. For level-triggered flows, the framework can often get away with treating EOI as the only visible step. For edge-triggered flows, especially on hierarchical controllers, deferring the claim until EOI can silently lose edges. The EXIU fix is a reminder that the distinction is not academic: putting the register write in the wrong callback produced a real acknowledgment bug, and correcting it required changing the flow handler itself.
References
[1] Daniel Thompson, “irqchip/exiu: Fix acknowledgment of edge triggered interrupts,” Linux kernel patch, lore.kernel.org, 2022. https://lore.kernel.org/all/20220429183605.gld37gz6taa5k7fk@maple.lan/
[2] Daniel Thompson, “Re: [PATCH v2] irqchip/exiu: Fix acknowledgment of edge triggered interrupts,” Linux-Kernel Archive, 29 April 2022. https://lkml.iu.edu/hypermail/linux/kernel/2204.3/08991.html
[3] Benjamin Herrenschmidt, “genirq vs. fastack,” LKML, 30 May 2006. https://lkml.org/lkml/2006/5/30/427
[4] Ard Biesheuvel, “ArmPkg/GicV3Dxe: Don’t signal EOI on arbitrary interrupts,” quoting Marc Zyngier on GIC state-machine ordering, Arm Reference Solutions edk2, 2021. https://git.gitlab.arm.com/arm-reference-solutions/edk2/-/commits/63fddc98e06c380e654b1cfbaf24b9fd922adfad
[5] Linux kernel source, include/linux/irq.h, struct irq_chip documentation for @irq_ack and @irq_eoi. https://gitee.com/openeuler/kernel/blob/49fd04425a505eb9de44e91584b9ead4a9f153b5/include/linux/irq.h
[6] Linux kernel source, kernel/irq/chip.c, documentation for handle_fasteoi_ack_irq. https://atomgit.com/raspberrypi-kernel/kernel/irq/chip.c