What is chained IRQ ? What does chained_irq_enter
and chained_irq_exit
do, because after an interrupt is arised the IRQ line is disabled, but chained_irq_enter
is calling functions related to masking interrupts. If the line is already disabled why to mask the interrupt ?
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Kernel oops Oops: 80000005 on arm embedded system
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
There are two approaches how to call interrupt handlers for child devices in IRQ handler of parent (interrupt controller) device.
Chained interrupts:
generic_handle_irq()
is used for interrupts chainingNested interrupts
handle_nested_irq()
is used for creating nested interruptshandle_nested_irq()
function; we need them to be run in process context, so that we can call sleeping bus functions (like I2C functions that may sleep)Speaking of drivers discussed above:
irq-gic
driver usesCHAINED GPIO irqchips
approach for handling systems with multiple GICs; this commit adds that functionalitygpio-omap
driver (mentioned above) usesGENERIC CHAINED GPIO irqchips
approach. See this commit. It was converted from using regularCHAINED GPIO irqchips
so that on real-time kernel it will threaded IRQ handler, but on non-RT kernel it will be hard IRQ handlerNESTED THREADED GPIO irqchips
approachThose functions implement hardware interrupt flow control, i.e. notifying interrupt controller chip when to mask and unmask current interrupt.
For FastEOI interrupt controllers (most modern way):
chained_irq_enter()
do nothingchained_irq_exit()
callsirq_eoi()
callback to tell the interrupt controller that interrupt processing is finishedFor interrupt controllers with mask/unmask/ack capabilities
chained_irq_enter()
masks current interrupt, and acknowledges it if ack callback is set as wellchained_irq_exit()
unmasks interruptIRQ line is disabled. But we still need to write to EOI register in the end of interrupt processing. Or send ACK for edge-level interrupts.
This explains why interrupts are disabled in interrupt handler.
Read Linux kernel documentation itself for understanding these APIs:
https://www.kernel.org/doc/Documentation/gpio/driver.txt