On Wed, May 13, 2015 at 12:55:46AM -0700, Hongfei Cheng wrote:
> Hi All,
> 
> In the document of "Porting Xenomai dual kernel to a new ARM SoC",
> section "flow handler" states: If the flow handler is
> “handle_edge_irq”, and the system locks up when the first interrupt
> happens, try replacing “handle_edge_irq” with “handle_level_irq”.
> 
> Could anyone explain why “handle_edge_irq” can cause system to hang
> while “handle_level_irq” doesn't? I searched the archives but failed
> to find any discussion on this topic.

level irqs are acked and masked at interrupt controller level on
entry, whereas edge interrupts are only acked. The Adeos patch
unmasks the irqs at processor level after this initial ack and mask
or ack. So, if the interrupt controller keeps the interrupt asserted
at the processor level when the level stays the same (IOW, if the
interrupt controller only supports the "level" behaviour), unmasking
the interrupt line will cause the interrupt to trigger again, being
ack again, etc... without any chance for the handler to ack the
interrupt at device level. The fix is to use handle_level_irq so
that the irq is masked at interrupt controller level before irqs are
unmasked at processor level.

This does not happen with an unpatched kernel, because irqs are not
unmasked at processor level until the handler has had a chance to
execute and ack the interrupt at device level.

-- 
                                            Gilles.

_______________________________________________
Xenomai mailing list
[email protected]
http://xenomai.org/mailman/listinfo/xenomai

Reply via email to