All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Bottom half task scheduling
@ 2010-09-11 20:08 Travis Stratman
  2010-09-11 20:26 ` Gilles Chanteperdrix
  2010-09-12  8:53 ` Jan Kiszka
  0 siblings, 2 replies; 7+ messages in thread
From: Travis Stratman @ 2010-09-11 20:08 UTC (permalink / raw)
  To: xenomai

Hello,

I am writing a Xenomai driver with an interrupt that must trigger a
complex series of hardware accesses that may not be atomic (i.e. waiting
for DMA to complete). I'd like to move this section to a bottom half. In a
Linux driver I would use a workqueue but I haven't been able to determine
what the preferred method would be in Xenomai. All of the task creation
API that I have considered cannot be called from an interrupt handler as
they may reschedule.

Can anyone point me to some documentation or example that covers this? Any
pointers would be appreciated.

Thanks,

TAS



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

* Re: [Xenomai-help] Bottom half task scheduling
  2010-09-11 20:08 [Xenomai-help] Bottom half task scheduling Travis Stratman
@ 2010-09-11 20:26 ` Gilles Chanteperdrix
  2010-09-12  2:49   ` Travis Stratman
  2010-09-12  8:53 ` Jan Kiszka
  1 sibling, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2010-09-11 20:26 UTC (permalink / raw)
  To: tstratman; +Cc: xenomai

Travis Stratman wrote:
> Hello,
> 
> I am writing a Xenomai driver with an interrupt that must trigger a
> complex series of hardware accesses that may not be atomic (i.e. waiting
> for DMA to complete). I'd like to move this section to a bottom half. In a
> Linux driver I would use a workqueue but I haven't been able to determine
> what the preferred method would be in Xenomai. All of the task creation
> API that I have considered cannot be called from an interrupt handler as
> they may reschedule.
> 
> Can anyone point me to some documentation or example that covers this? Any
> pointers would be appreciated.

You can use a kernel thread, created with rtdm_task_init:
http://www.xenomai.org/documentation/xenomai-2.5/html/api/group__rtdmtask.html#g44b0701b6c28fa8035711f800fdcd371

-- 
                                                                Gilles.


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

* Re: [Xenomai-help] Bottom half task scheduling
  2010-09-11 20:26 ` Gilles Chanteperdrix
@ 2010-09-12  2:49   ` Travis Stratman
  0 siblings, 0 replies; 7+ messages in thread
From: Travis Stratman @ 2010-09-12  2:49 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai


> You can use a kernel thread, created with rtdm_task_init:
> http://www.xenomai.org/documentation/xenomai-2.5/html/api/group__rtdmtask.html#g44b0701b6c28fa8035711f800fdcd371

Thanks Gilles. That's what I needed, I just couldn't find any verification
that this could be called from the interrupt handler.

TAS





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

* Re: [Xenomai-help] Bottom half task scheduling
  2010-09-11 20:08 [Xenomai-help] Bottom half task scheduling Travis Stratman
  2010-09-11 20:26 ` Gilles Chanteperdrix
@ 2010-09-12  8:53 ` Jan Kiszka
  2010-09-12 13:42   ` Travis Stratman
  1 sibling, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2010-09-12  8:53 UTC (permalink / raw)
  To: tstratman; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

Am 11.09.2010 22:08, Travis Stratman wrote:
> Hello,
> 
> I am writing a Xenomai driver with an interrupt that must trigger a
> complex series of hardware accesses that may not be atomic (i.e. waiting
> for DMA to complete). I'd like to move this section to a bottom half. In a
> Linux driver I would use a workqueue but I haven't been able to determine
> what the preferred method would be in Xenomai. All of the task creation
> API that I have considered cannot be called from an interrupt handler as
> they may reschedule.

Simply create the RTDM task(s) in advance. Creating tasks on demand and
in IRQ context would be crazy.

At this chance, also start thinking about what priorities you want to
assign to them (typically the harder part of the design).

> 
> Can anyone point me to some documentation or example that covers this? Any
> pointers would be appreciated.

RTnet uses RTDM tasks quite heavily. But its code base is large, and not
all usages are really good examples anymore.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

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

* Re: [Xenomai-help] Bottom half task scheduling
  2010-09-12  8:53 ` Jan Kiszka
@ 2010-09-12 13:42   ` Travis Stratman
  2010-09-12 13:48     ` Jan Kiszka
  0 siblings, 1 reply; 7+ messages in thread
From: Travis Stratman @ 2010-09-12 13:42 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai


> Simply create the RTDM task(s) in advance. Creating tasks on demand and
> in IRQ context would be crazy.

This is what I have confusion about. After creating a non-cyclic task with rtdm_task_init(), how
do I restart the task in the interrupt handler? Is there a way to do this using
rtdm_task_set_period() or some other task function or do I need to have the task wait on an event
and wake it back up by signaling the event from the ISR?

>
> At this chance, also start thinking about what priorities you want to
> assign to them (typically the harder part of the design).
>
>>
>> Can anyone point me to some documentation or example that covers this? Any
>> pointers would be appreciated.
>
> RTnet uses RTDM tasks quite heavily. But its code base is large, and not
> all usages are really good examples anymore.

Thanks, I will take a look at the RTnet source with that in mind.

>
> Jan
>
>

Thanks,

TAS




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

* Re: [Xenomai-help] Bottom half task scheduling
  2010-09-12 13:42   ` Travis Stratman
@ 2010-09-12 13:48     ` Jan Kiszka
  2010-09-12 14:13       ` Travis Stratman
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2010-09-12 13:48 UTC (permalink / raw)
  To: tstratman; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

Am 12.09.2010 15:42, Travis Stratman wrote:
> 
>> Simply create the RTDM task(s) in advance. Creating tasks on demand and
>> in IRQ context would be crazy.
> 
> This is what I have confusion about. After creating a non-cyclic task with rtdm_task_init(), how
> do I restart the task in the interrupt handler? Is there a way to do this using
> rtdm_task_set_period() or some other task function or do I need to have the task wait on an event
> and wake it back up by signaling the event from the ISR?

The latter is the pattern you are looking for. Just loop over
rtdm_event_event and the work it has to perform on wakeup.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

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

* Re: [Xenomai-help] Bottom half task scheduling
  2010-09-12 13:48     ` Jan Kiszka
@ 2010-09-12 14:13       ` Travis Stratman
  0 siblings, 0 replies; 7+ messages in thread
From: Travis Stratman @ 2010-09-12 14:13 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

>
> The latter is the pattern you are looking for. Just loop over
> rtdm_event_event and the work it has to perform on wakeup.
>
> Jan
>
>

Thanks Jan.

TAS



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

end of thread, other threads:[~2010-09-12 14:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-11 20:08 [Xenomai-help] Bottom half task scheduling Travis Stratman
2010-09-11 20:26 ` Gilles Chanteperdrix
2010-09-12  2:49   ` Travis Stratman
2010-09-12  8:53 ` Jan Kiszka
2010-09-12 13:42   ` Travis Stratman
2010-09-12 13:48     ` Jan Kiszka
2010-09-12 14:13       ` Travis Stratman

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.