All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] IRQ latency
       [not found] ` <C7408997F5B0784C970ED53C11855FAE01111232AFE7@domain.hid>
@ 2012-05-16 15:55   ` Jean-Pascal JULIEN
  2012-05-16 16:04     ` gilles.chanteperdrix
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Pascal JULIEN @ 2012-05-16 15:55 UTC (permalink / raw)
  To: xenomai@xenomai.org

Hi,

I installed xenomai on an overo water board (cortex A8) and performed latency tests.
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 ?



Thanks in advance,

JP


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai-help] IRQ latency
  2012-05-16 15:55   ` [Xenomai-help] IRQ latency Jean-Pascal JULIEN
@ 2012-05-16 16:04     ` gilles.chanteperdrix
  2012-05-16 16:07       ` gilles.chanteperdrix
  2012-05-18  7:06       ` [Xenomai-help] RE : " Jean-Pascal JULIEN
  0 siblings, 2 replies; 5+ messages in thread
From: gilles.chanteperdrix @ 2012-05-16 16:04 UTC (permalink / raw)
  To: Jean-Pascal JULIEN; +Cc: xenomai@xenomai.org

> 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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai-help] IRQ latency
  2012-05-16 16:04     ` gilles.chanteperdrix
@ 2012-05-16 16:07       ` gilles.chanteperdrix
  2012-05-18  7:06       ` [Xenomai-help] RE : " Jean-Pascal JULIEN
  1 sibling, 0 replies; 5+ messages in thread
From: gilles.chanteperdrix @ 2012-05-16 16:07 UTC (permalink / raw)
  To: gilles.chanteperdrix; +Cc: xenomai@xenomai.org

>> Hi,
>>
>> I installed xenomai on an overo water board (cortex A8) and performed
>> latency tests.
>
> What version of Xenomai?

And more importantly, what version of the I-pipe patch.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Xenomai-help] RE :  IRQ latency
  2012-05-16 16:04     ` gilles.chanteperdrix
  2012-05-16 16:07       ` gilles.chanteperdrix
@ 2012-05-18  7:06       ` Jean-Pascal JULIEN
  2012-05-18  7:49         ` Gilles Chanteperdrix
  1 sibling, 1 reply; 5+ messages in thread
From: Jean-Pascal JULIEN @ 2012-05-18  7:06 UTC (permalink / raw)
  To: gilles.chanteperdrix@xenomai.org; +Cc: xenomai@xenomai.org

>> 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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai-help] RE :  IRQ latency
  2012-05-18  7:06       ` [Xenomai-help] RE : " Jean-Pascal JULIEN
@ 2012-05-18  7:49         ` Gilles Chanteperdrix
  0 siblings, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2012-05-18  7:49 UTC (permalink / raw)
  To: Jean-Pascal JULIEN; +Cc: xenomai@xenomai.org

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-18  7:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <C7408997F5B0784C970ED53C11855FAE011112339155@domain.hid>
     [not found] ` <C7408997F5B0784C970ED53C11855FAE01111232AFE7@domain.hid>
2012-05-16 15:55   ` [Xenomai-help] IRQ latency Jean-Pascal JULIEN
2012-05-16 16:04     ` gilles.chanteperdrix
2012-05-16 16:07       ` gilles.chanteperdrix
2012-05-18  7:06       ` [Xenomai-help] RE : " Jean-Pascal JULIEN
2012-05-18  7:49         ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.