Search code examples
linux-kernellinux-device-driverirq

Interrupt handler triggered when free_irq is called


My problem is: Interrupt handler get triggered when free_irq is called. I noticed in kernel messages that handler is invoked but since our device hasn't requested interrupt it prompted that no interrupt has received. Is it expected behavior ? Can anybody please help ?


Solution

  • When you are registering a handler for a (possibly) shared interrupt (with IRQF_SHARED), the interrupt can be triggered by other devices over which your driver has no control, so your driver must be prepared to receive an interrupt at any time.

    To help with debugging drivers, the kernel will (when CONFIG_DEBUG_SHIRQ is set) fake some interrupts to check that your driver works correctly.
    [source code]