[Xenomai-help] RE : IRQ latency

2012-05-18 Thread Jean-Pascal JULIEN
 Hi,

 I installed xenomai on an overo water board (cortex A8) and performed
 latency tests.

What version of Xenomai?

 I tested two modules.
 The first module is based on an internal timer. It toggles a GPIO each
 1ms.
 The second module waits for an external interrupt from an input GPIO
 (square signal at 1KHz). When that happens, the module toggles a GPIO pin.

 When i load the system and do a transfer from Ethernet to the sd card the
 first module works fine with a maximum latency less than 50us.
 But the second module, in the same context, have a maximum latency of
 several milliseconds.

 As the first module works fine i think i have a problem with the hardware
 configuration like the hardware irq priority.
 In the irq.c file, the irq priority level is not set for the linux domain.

 Should i configure the irq level at the initialization of the board ? What
 else could cause this issue ?

The error is more likely in the code of your driver. Show us the code.

Hi Gilles,


Sorry, i forgot the essential.
My linux kernel version is the 2.6.38 from sakoman. 
My xenomai version is xenomai-2.6.0
The adeos patch is : adeos-ipipe-2.6.38.8-arm-1.18-04.patch ( 
./prepare-kernel.sh --linux=${WORKDIR}/git --arch=arm 
--adeos=${WORKDIR}/xenomai-2.6.0/ksrc/arch/arm/patches/adeos-ipipe-2.6.38.8-arm-1.18-04.patch).
The xenomai user space is make with the next configuration : 
 ./configure --build=arm-ti-linux --host=arm-none-linux-gnueabi --prefix=/usr 
--includedir=/usr/include/xenomai  --enable-arm-tsc=omap3   --disable-dox-doc 
--disable-dbx LDFLAGS=-Wl,-O1 -Wl,--hash-style=gnu


The module code is :

For the init of the module:
-
if (!(((gpio_request(RX_TST_GPIO,RX_TST_GPIO) == 0) 
(gpio_direction_input(RX_TST_GPIO) == 0 {
rtdm_printk(KERN_DEBUG Could not claim GPIO for 
TX_SPACE_AVAILABLE_GPIO\n);
erreur_return |= 1;
return -1;
}

if (!(((gpio_request(TX_TST_GPIO,RX_TST_GPIO) == 0) 
(gpio_direction_output(TX_TST_GPIO,0) == 0 {
rtdm_printk(KERN_DEBUG Could not claim GPIO for 
TX_SPACE_AVAILABLE_GPIO\n);
erreur_return |= 2;
return -1;
} 


ret = request_irq(gpio_to_irq(RX_TST_GPIO),
space_available_irqhandler,
IRQF_TRIGGER_FALLING|IRQF_DISABLED, usrp_intr_aviable, NULL);
if((ret!=0)){ rtdm_printk(KERN_DEBUG Could not request irq\n); 
erreur_return |= 4;}

disable_irq(gpio_to_irq(RX_TST_GPIO));
free_irq(gpio_to_irq(RX_TST_GPIO), NULL);

err = rtdm_irq_request(rt_irq_handle, gpio_to_irq(RX_TST_GPIO), 
rt_data_ready_irqhandler, RTDM_IRQTYPE_EDGE, XENO_IRQ_RECEIVE,NULL);
err = rtdm_irq_enable(rt_irq_handle);

The irq code is:
-
static int rt_data_ready_irqhandler(rtdm_irq_t *irq_handle) 
{

iomask ^= 1;
gpio_set_value(TX_TST_GPIO, iomask);

return RTDM_IRQ_HANDLED;
}


Thanks for your help.

JP


___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] RE : IRQ latency

2012-05-18 Thread Gilles Chanteperdrix
On 05/18/2012 09:06 AM, Jean-Pascal JULIEN wrote:
 Hi,

 I installed xenomai on an overo water board (cortex A8) and performed
 latency tests.
 
 What version of Xenomai?
 
 I tested two modules.
 The first module is based on an internal timer. It toggles a GPIO each
 1ms.
 The second module waits for an external interrupt from an input GPIO
 (square signal at 1KHz). When that happens, the module toggles a GPIO pin.

 When i load the system and do a transfer from Ethernet to the sd card the
 first module works fine with a maximum latency less than 50us.
 But the second module, in the same context, have a maximum latency of
 several milliseconds.

 As the first module works fine i think i have a problem with the hardware
 configuration like the hardware irq priority.
 In the irq.c file, the irq priority level is not set for the linux domain.

 Should i configure the irq level at the initialization of the board ? What
 else could cause this issue ?
 
 The error is more likely in the code of your driver. Show us the code.
 
 Hi Gilles,
 
 
 Sorry, i forgot the essential.
 My linux kernel version is the 2.6.38 from sakoman. 
 My xenomai version is xenomai-2.6.0
 The adeos patch is : adeos-ipipe-2.6.38.8-arm-1.18-04.patch ( 
 ./prepare-kernel.sh --linux=${WORKDIR}/git --arch=arm 
 --adeos=${WORKDIR}/xenomai-2.6.0/ksrc/arch/arm/patches/adeos-ipipe-2.6.38.8-arm-1.18-04.patch).
 The xenomai user space is make with the next configuration : 
  ./configure --build=arm-ti-linux --host=arm-none-linux-gnueabi --prefix=/usr 
 --includedir=/usr/include/xenomai  --enable-arm-tsc=omap3   --disable-dox-doc 
 --disable-dbx LDFLAGS=-Wl,-O1 -Wl,--hash-style=gnu

You do not need --enable-arm-tsc.

I see nothing wrong with your code. However this version of the I-pipe
patch has a bug with gpio irqs. You can try backporting this patch:

http://git.xenomai.org/?p=ipipe-gch.git;a=commit;h=81bfc05c4716b76e79f5e486baf4c52015a3b92c

To fix it. If that is the cause of your problem, then you should only
see the bug if you are running some other real-time program which
triggers a user-space task wakeup based in an interrupt, such as for
instance the timer interrupt. Running the latency test for instance
would do that.


-- 
Gilles.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


[Xenomai-help] [REMINDER] Migrating Xenomai mailing lists

2012-05-18 Thread Philippe Gerum


We will soon be moving all our mailing lists out of gna.org to host them 
on xenomai.org instead.


At this chance, xenomai-help@gna.org, xenomai-c...@gna.org and 
adeos-m...@gna.org will be merged into a single list named 
xeno...@xenomai.org. These are low traffic lists, so we want to group 
all Xenomai-related discussions in one place.


Commits to the development trees will be sent to
xenomai-...@xenomai.org.

The migration is scheduled for May 19, all current subscribers of the 
former lists will be automatically subscribed to xeno...@xenomai.org.

You will receive an automated mail from our Mailman when this happens.

The Mailman interface to the new lists is available at: 
http://www.xenomai.org/mailman/listinfo/xenomai.


Please drop a mail to mail...@xenomai.org in case of issue.

Thanks,

--
Philippe.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help