Freeing IRQs

The reverse scheme is adopted in order to free interrupts. First, the interrupt controller is informed that the IRQ has been removed by means of a hardware-specific (chip->shutdown) function,11 and then the relevant entries are removed from the general data structures of the kernel. The auxiliary function free_irq assumes these tasks. While it has been an architecture-dependent function before the genirq rework, it can today be found in kernel/irq/manage.c.

When an IRQ handler is required to remove a shared interrupt, the number alone is not sufficient to identify the IRQ. In this case, it is necessary to also use the dev_id discussed above for purposes of

10If no explicit startup function is available, the IRQ is simply enabled by calling chip->enable instead.

11If no explicit shutdown function is available, the interrupt is simply disabled by chip->disable instead.

unique identification. The kernel scans the list of all registered handlers until it finds a matching element (with a matching dev_id). Only then can the entry be removed.

Continue reading here: Registering Interrupts

Was this article helpful?

0 0