From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>, adeos-main <adeos-main@gna.org>
Subject: Re: [Xenomai-core] [Adeos-main] [BUG] pit clocksource broken under Xenomai
Date: Mon, 14 May 2007 20:36:35 +0200 [thread overview]
Message-ID: <4648AC33.6090902@domain.hid> (raw)
In-Reply-To: <4648A597.70600@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]
Jan Kiszka wrote:
> Jan Kiszka wrote:
>> Hi,
>>
>> just checked on real hardware (found in qemu originally):
>>
>> When Linux uses the pit clocksource AND Xenomai is attached, the system
>> time no longer makes progress. Observed under 2.6.20 with 1.7-03 and
>> newer patches, Xenomai trunk.
>>
>> I guess not many people will be affected by this and I'm lacking time to
>> debug, so I'm just dumping the report and running away...
>
> Somehow I hate open issues...
>
> I recalled some private thread with you, Philippe, about this particular
> line in pid_read(). A look at it again revealed the reason for this bug.
>
> Jan
>
> PS: pending_patches++ ;)
>
>
> ---
> arch/i386/kernel/i8253.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: linux-2.6.20/arch/i386/kernel/i8253.c
> ===================================================================
> --- linux-2.6.20.orig/arch/i386/kernel/i8253.c
> +++ linux-2.6.20/arch/i386/kernel/i8253.c
> @@ -47,7 +47,8 @@ static cycle_t pit_read(void)
>
> #ifdef CONFIG_IPIPE
> if (!__ipipe_pipeline_head_p(ipipe_root_domain))
> - return 0; /* We don't really own the PIT. */
> + /* We don't own the PIT, fall back to jiffies. */
> + return (cycle_t)(jiffies * LATCH);
I think even more correct would be
return (cycle_t)(jiffies * LATCH) + (LATCH - 1) - old_count;
Should avoid the theoretical chance of a clock backward jump when
Xenomai attaches. I leave it up to the maintainer to decide. :)
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2007-05-14 18:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-13 22:22 [Xenomai-core] [BUG] pit clocksource broken under Xenomai Jan Kiszka
2007-05-14 18:08 ` Jan Kiszka
2007-05-14 18:36 ` Jan Kiszka [this message]
2007-05-15 7:57 ` [Xenomai-core] [Adeos-main] " Philippe Gerum
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=4648AC33.6090902@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=adeos-main@gna.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.