I'm sure there's a good reason for this, but I can't see what it is. Inside __handle_irq_event_percpu
the kernel loops over all the handlers registered for a particular IRQ line and calls it. What I don't understand is why this loop isn't exited when the first handler returning IRQ_HANDLED
is reached? It seems like a simple performance improvement, so there must be something I don't understand.
Does anyone know why?
In the Linux source tree, __handle_irq_event_percpu() is in kernel/irq/handle.c:
The for_each_action_of_desc(desc, action) macro travels in the action list of the IRQ descriptor:
There are multiple entries in the action list if the interrupt line is shared by several devices. So, several devices may enter in interrupt state at the same time. Hence, the action is to be called for all the devices sharing the line to check if there is something to do.
N.B.: