All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Smolorz <Sebastian.Smolorz@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] timer-handling adeos/xenomai on arm
Date: Sat, 11 Nov 2006 19:45:09 +0100	[thread overview]
Message-ID: <200611111945.10309.Sebastian.Smolorz@domain.hid> (raw)
In-Reply-To: <17749.64255.935835.17174@domain.hid>

Gilles Chanteperdrix wrote:
> Sebastian Smolorz wrote:
>  > Sebastian Smolorz wrote:
>  > > Gilles Chanteperdrix wrote:
>  > > > Schlägl "Manfred jun." wrote:
>  > > >  > Hi again!
>  > > >  >
>  > > >  > I've the presumption, there is something wrong with my
>  > > >  > timer-handling. Could you please take a look at my handling.
>  > > >  >
>  > > >  > Thanks in advance!
>  > > >
>  > > > The problem I see with your code is that you are updating
>  > > > ns_timer_lxlost in __ipipe_mach_acktimer, the integrator
>  > > > architecture code, which also uses a decrementer does not do that.
>  > > > Apart from that, I see nothing wrong.
>  > >
>  > > I see another one which has to do with the fact that __ipipe_mach_tsc
>  > > is updated both in __ipipe_mach_get_tsc and __ipipe_mach_set_dec. This
>  > > leads to double-added ticks because the latter funcion is called only
>  > > once a period and the former even more than once. So Xenomai counts
>  > > jiffies in /proc/xenomai/timer to fast. Manfred, can you confirm this?
>  >
>  > Forget this, my eyes weren't open this morning ... In 
>  > __ipipe_mach_get_tsc there is no update of __ipipe_mach_tsc, of course.
>
> Right, but __ipipe_mach_tsc and ns_timer_lxlost get also updated in
> __ipipe_mach_acktimer, this looks wrong, in the integrator
> implementation, they are updated in the timer interrupt, only if the
> timer is not stolen.

OK, let's speculate a little bit. (Maybe all of the following turns out to be 
completely wrong, but it wouldn't be the first time for me today. ;-) 
Hopefully Manfred can give some comments which pieces of my speculation are 
right.)

The timer counts down to zero, causes an interrupt and then reloads 
automatically with ns_timer_reload. So, when __ipipe_mach_acktimer is called 
ns_timer_reload ticks have passed and can be added to __ipipe_mach_tsc and 
ns_timer_lxlost. Some ticks later, __ipipe_mach_set_dec is executed, the 
passed ticks are added to __ipipe_mach_tsc and ns_timer_lxlost and the timer 
is reprogrammed to the new value.

Could be right ...

Sebastian


  reply	other threads:[~2006-11-11 18:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-06 11:03 [Xenomai-help] timer-handling adeos/xenomai on arm Schlägl Manfred jun.
2006-11-11 11:05 ` Gilles Chanteperdrix
2006-11-11 11:39   ` Philippe Gerum
2006-11-11 12:54     ` Gilles Chanteperdrix
2006-11-11 11:52   ` Sebastian Smolorz
2006-11-11 14:33     ` Sebastian Smolorz
2006-11-11 16:31       ` Gilles Chanteperdrix
2006-11-11 18:45         ` Sebastian Smolorz [this message]
2006-11-11 21:01           ` Gilles Chanteperdrix
2006-11-12 18:51             ` Sebastian Smolorz
2006-11-13  8:44               ` Gilles Chanteperdrix
2006-11-13  9:17                 ` Sebastian Smolorz

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=200611111945.10309.Sebastian.Smolorz@domain.hid \
    --to=sebastian.smolorz@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --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.