分类: LINUX
2012-10-28 15:19:50
Reentrant interrupt definition is “If an interrupt handler re-enables interrupts, then calls a subroutine, and another interrupt occurs ….” from ARM Information Center
Interrupt Process on Linux
1. When ARM entry to IRQ, disable I on CPSR register, which means default ARM disable irq Reentrant Interrupt.
2. Kernel received interrupt, when call “handle_level_irq”, it calls i.mx25 bsp to disable the same irq number on i.mx25 interrupt controller as below mark1.
3. But when Linux kernel calls “handle_IRQ_event”, kernel checks the flag which we set when call “request_irq” function. Default the flag we don’t set IRQF_DISABLED, Linux kernel enable irq as below market red color mark2 that means at this moment kernel enable Reentrant Interrupt but the same irq number on the interrupt controller can’t trigger interrupt.
点击(此处)折叠或打开
Summarize
1. When register irq interrupt by calling “request_irq”, we don’t set flags as “IRQF_DISABLED”, the irq interrupt is Reentrant.
2. But there is risk on setting “IRQF_DISABLED”, it means another high priority interrupt can’t interrupt irq handle process from ARM entry to irq mode, finish your irq handle, to kernel back to preview mode.
3. In my opinion for the system performance we don’t advice use “IRQF_DISABLED” flag.
For speed up or ensure concurrency safe on your irq handle, please add “spin_lock_irq” or “spin_lock_irqsave” in your register irq handle, “spin_unlock_irq “or “spin_unlock_irqrestore” when exits irqhandle.
It can be disable Reentrant Interrupt just in your register the irq handle. When high irq interrupt can preempt your irq before the kernel jump to your irq handle, so please keep your irq handle (top half) fast and small.