2010-12-16 05:49:59 Edge triggered GPIO Interrupts are not cleared when Xenomai is enabled
Rainer Kloud (AUSTRIA)
I have the following problem on my custom board with BF531 (I'm useing the 2010R1 release):
I have configured a PF Pin as input for generating interrupts. The interrupt is configured as edge triggered in both directions. When I run the plain linux kernel, I can catch the interrupt with my custom ISR. But when I enable Xenomai the system hangs when the first interrupt occures. I have found out, that the PF interrupt is not cleared by the kernel and so I get endless interrupts. When I clear the Interrupt in my private ISR everything works correct.
But normally the kernel should clear the Interrupt as it is done whith disabled Xenomai. So I took a look into the kernel sources and I fount the following:
In function bfin_set_irq_handler (ints-priority.c) the IRQ handler is always set to handle_level_irq when xenomai is enabled (with __fixup_irq_handler). This leads to a problem when useing edge triggered IRQ because in function bfin_gpio_mask_ack_irq the IRQ handler is checked if it is the edge or the level IRQ handler. Because now every GPIO interrupt is handled as a level triggered interrupt, the edge interrupt is not cleared correctly and the interrupt is still active.
2010-12-23 05:47:46 Re: Edge triggered GPIO Interrupts are not cleared when Xenomai is enabled
Aaron Wu (CHINA)
Hi Have you solved your problem? I did a simple test on my side and it seems to be working fine. Here is what I did: with a bf533 stamp board, I request IRQ_PF5 as both edges triggered, then I enable the xenomai, the result is the interrupt handler is triggered normaly, did not see the system hang. By the way my distribution version is r9994.
2011-08-18 07:08:18 Re: Edge triggered GPIO Interrupts are not cleared when Xenomai is enabled
Kolja Waschk (GERMANY)
I think I stumbled across the same(?) problem. Only if I comment out the dependency on the descr->handle_irq == edge vs. level in bfin_gpio_mask_ack_irq and let it call set_gpio_data(gpionr, 0) in any case it won't hang my system.