All of lore.kernel.org
 help / color / mirror / Atom feed
From: Detlef Vollmann <dv@domain.hid>
To: xenomai@xenomai.org
Cc: Jan Kiszka <jan.kiszka@domain.hid>
Subject: Re: [Xenomai-core] Some questions about the ARM port (Integrator vs.	PXA)
Date: Thu, 06 Jul 2006 01:44:16 +0200	[thread overview]
Message-ID: <44AC4ED0.4C1BF83E@vollmann.ch> (raw)
In-Reply-To: 17579.47238.90918.989854@domain.hid

Gilles Chanteperdrix wrote:
> Detlef Vollmann wrote:

>  > I'll just add another test after the update of OSMR0 for the
>  > case that we got interrupted between the comparison and the
>  > assignment.  And in that (probably very rare) case I accept that
>  > I loose a timer tick :-(
> 
> I do not see what you mean.
Sorry, I didn't see that the code is running under IRQ-lock.

> "delay" value does not change over time.
Well, ipipe_tune_timer() is in the public interface of ipipe,
so it might be used for all kind of things...

> 
>  >
>  > Also, this way the timer comes a bit early, so any handler that
>  > checks the TSC might think that this is the wrong interrupt --
>  > and wait forever for the correct one.
>  > But the only other option would be the busy wait...
> 
> It will work for Xenomai:
> - in periodic mode, each interrupt is treated as a tick
> - in aperiodic mode, there are two guards; first the tsc is compared to
>   the next software timer expiration date using nkschedlat as a margin;
>   second, if the tick is so early that there is no software timer
>   expiration to  handle, no software timer will be dequeued and the next
>   software timer expiration date will be reused to reprogram the
>   hardware timer.
Ok, so the busy wait would be in the loop between do_tick_aperiodic
and __ipipe_mach_set_dec: the next expiration date is not yet
reached, but it is to close to do the update.

> As explained above, this recursion can only happen for a limited time
> (in the worst case, if nkschedlat is 0, during 8 hardware timer ticks).
> Keep in mind that these functions are called with interrupts off, so the
> "recursion", is serialized.
Ok, understood.  Thanks for the detailed explanation.

> You should really have a look at ksrc/nucleus/timer.c, functions
> do_tick_aperiodic and do_tick_periodic.
Thanks for the pointer.

And I think you're correct, for Xenomai it will work.
Unfortunately I'm trying to do a general ipipe port for PXA.
I'm doing this for a polytech who wants to use this with their
students, and so they probably want to use it with other domain
on top of ipipe (rtai 3.3, Siemens' implementation of the Posix
RT interface, and maybe even an own domain for experimenting).

But probably all aperiodic timers need such a scheme, so I'll
not busy loop for now.

Thanks again for your explanation
 Detlef

-- 
Detlef Vollmann   vollmann engineering gmbh
Linux and C++ for Embedded Systems    http://www.vollmann.ch/
Linux for PXA270 Colibri module: http://www.vollmann.ch/en/colibri/


  reply	other threads:[~2006-07-05 23:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29  8:38 [Xenomai-core] Some questions about the ARM port (Integrator vs. PXA) Detlef Vollmann
2006-06-29 14:46 ` Stelian Pop
2006-06-30  6:31   ` Detlef Vollmann
     [not found]   ` <44A4C4CB.5F24DA68@domain.hid>
2006-06-30  8:53     ` Stelian Pop
2006-07-03  5:56       ` Detlef Vollmann
2006-07-03  6:33         ` Jan Kiszka
2006-07-03  8:38           ` Detlef Vollmann
2006-07-03  9:37             ` Jan Kiszka
2006-07-03 12:39             ` Gilles Chanteperdrix
2006-07-03 13:00               ` Gilles Chanteperdrix
2006-07-04  6:43                 ` Detlef Vollmann
2006-07-04 14:09                   ` Jan Kiszka
2006-07-05 22:32                     ` Detlef Vollmann
2006-07-05 22:42                       ` Detlef Vollmann
2006-07-05 13:03                   ` Gilles Chanteperdrix
2006-07-05 23:44                     ` Detlef Vollmann [this message]
2006-07-06  7:15                       ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44AC4ED0.4C1BF83E@vollmann.ch \
    --to=dv@domain.hid \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.