All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Detlef Vollmann <dv@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Some questions about the ARM port (Integrator vs.	PXA)
Date: Mon, 03 Jul 2006 11:37:25 +0200	[thread overview]
Message-ID: <44A8E555.3080800@domain.hid> (raw)
In-Reply-To: <44A8D7A1.4E4E9D27@domain.hid>

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

Detlef Vollmann wrote:
> Jan Kiszka wrote:
>> Detlef Vollmann wrote:
>>>>> Now I have another question on this: on the PXA I have a hardware
>>>>> problem so that I must sometimes set the next match value to the
>>>>> match value after the next one, so effectively loosing one
>>>>> interrupt.
>> Just out of curiosity: What is the technical background of this issue?
>> Does it mean that the hardware is not able to trigger a timer event over
>> a certain period of time and you therefore have to defer the event until
>> this is possible again? Do you know ahead of time when this will happen?
>> Or only when you try to set the timer and the hardware tells you about
>> it somehow?
> Here's the original comment and code from
>  linux/arch/arm/mach-pxa/time.c:
> 
>     /* Loop until we get ahead of the free running timer.
>      *
>      * HACK ALERT: it seems that the PXA timer regs aren't updated right
>      * away in all cases when a write occurs.  We therefore compare with
>      * 8 instead of 0 in the while() condition below to avoid missing a
>      * match if OSCR has already reached the next OSMR value.
>      * Experience has shown that up to 6 ticks are needed to work around
>      * this problem, but let's use 8 to be conservative.  Note that this
>      * affect things only when the timer IRQ has been delayed by nearly
>      * exactly one tick period which should be a pretty rare event.
>      */
>     do {
>         timer_tick(regs);
>         OSSR = OSSR_M0;  /* Clear match on timer 0 */
>         next_match = (OSMR0 += LATCH);
>     } while( (signed long)(next_match - OSCR) <= 8 );
> 
>> Looks like designing a real-time application around such a quirk isn't
>> that easy.
> It's not so difficult to work around the problem for a single system.
> What's difficult is to find a solution in a framework that wasn't
> built with such a problem in mind.

Indeed, but it should only require minimal changes to
rthal_timer_program_shot on arm (handle a potential return code of
__ipipe_mach_set_dec() as already suggested). Take a look at the i386
variant [1], how this one handles re-triggering of near-by ticks. I
don't see why busy-waiting should be required here to get the same
characteristics like the Linux code above. Or does Linux miss ticks even
with that "hack"?

Jan

[1]http://www.rts.uni-hannover.de/xenomai/lxr/source/include/asm-i386/hal.h?v=SVN-trunk#L178


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

  reply	other threads:[~2006-07-03  9:37 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 [this message]
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
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=44A8E555.3080800@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=dv@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.