Thanks Gilles,

I think setting the IRQ type mended the problem.

Before that I did some digging:
I couldn't find any information that indicated a shared interrupt:
The /proc/interrupts did not contain the IRQ155 and the /proc/xenomai/irq held 
only one entry for my driver (below).
The external interrupt source is a PWM generated pulse-train of 200Hz, i.e. 5ms 
interval started the code-line before entering the read-loop.
You say that the line must have been unserved for a 1000 events before being 
disabled.
A 1000 events from when and at what rate if EDGE not spesified? The irq handler 
have no optional returns but "RT_INTR_HANDLED".
Hence, I cannot imagine where the non-handled returns are coming from. At 5ms 
rate this would require 5s of pulses to reach 1000.
The distance in time from IRQ enable to disable the IRQ line seem less than 
4us..
[19833.958667] RTDM IMU 27 - enable IRQ
[19838.962472] Xenomai: xnintr_irq_handler: IRQ155 not handled. Disabling IRQ 
line.

However, I changed the flags to "RTDM_IRQTYPE_EDGE" and it seemed to have a 
good effect.
I don't get the message any longer 

Best regards
Terje

[  731.849026] RTDM IMU INT (GPIO 27) - open
[  731.849047] RTDM IMU pin 27 - irq number 155
[  731.849054] RTDM IMU 27 - request GPIO
[  731.849073] RTDM IMU 27 - request IRQ 155
[  731.849097] RTDM IMU 27 - set IRQ type RISING_EDGE
[  731.849112] RTDM IMU 27 - init semaphore
[  731.849122] RTDM IMU 27 - enable IRQ


/proc/xenomai/irq :
IRQ         CPU0
 67:      495238         [timer]
155:      298510         imu_rtdm
1031:           0         [sync]
1032:           0         [timer-ipi]
1033:           0         [reschedule]
1034:           0         [virtual]
1038:      298252         [virtual]

-----Original Message-----
From: Gilles Chanteperdrix [mailto:[email protected]] 
Sent: 2. desember 2014 11:54
To: Terje Frøysa
Cc: [email protected]
Subject: Re: [Xenomai] IRQ155 not handled. Disabling IRQ line

On Tue, Dec 02, 2014 at 10:20:59AM +0000, Terje Frøysa wrote:
> Thanks Gilles,
> 
> The flags are zero (from example code).... should I have used 
> RTDM_IRQTYPE_EDGE ?
> 
> err = rtdm_irq_request(&info->gpio_irq, gpio_irq_n, imu_irq_handler, 
> 0, THIS_MODULE->name,  NULL);

If the IRQ is of a certain type, you certainly want to pass the right irq type.

Looking at the code:
- you only get the message after not returning RTDM_IRQ_HANDLED 1000 times, so, 
if you see the message, it is sure that some code is not returning 
RTDM_IRQ_HANDLED, I suggest you check if the interrupt is shared, and if 
another handler is not called
- the xenomai core skips reenabling the interrupts in that case, so, if it gets 
reenabled, something re-enables it.

Are you sure that you do not register the handler to early, that it fires 
because the hardware is not initialized, then gets disabled by Xenomai core. 
Then later, your driver performs the hardware initializations, and re-enables 
irqs ?

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

Reply via email to