From: Philippe Gerum <rpm@xenomai.org>
To: Steve Kreyer <steve.kreyer@domain.hid>
Cc: xenomai@xenomai.org, Jan Kiszka <jan.kiszka@domain.hid>
Subject: Re: [Xenomai-help] Timer problems?
Date: Sun, 27 Aug 2006 16:25:36 +0200 [thread overview]
Message-ID: <1156688736.4325.80.camel@domain.hid> (raw)
In-Reply-To: <1156688557.4325.76.camel@domain.hid>
On Sun, 2006-08-27 at 16:22 +0200, Philippe Gerum wrote:
> On Sun, 2006-08-27 at 15:47 +0200, Steve Kreyer wrote:
> > Philippe Gerum wrote:
> > >> Moreover, and that's likely another reason for troubles here, you have
> > >> CONFIG_VT on. This normally unproblematic features collides with the TSC
> > >> emulation of Xenomai.
> > >>
> > >
> > > I'll jump on this, since this likely deserves some detailed
> > > explanations:
> > >
> > > The general problem with CONFIG_VT, is the tone generator it uses to
> > > send bell events to the user, issued by the keyboard management code. On
> > > x86, the related kernel code fiddles with the legacy programmable
> > > interrupt timer (PIT) to create an audible tone, specifically this
> > > chip's channels #0 and #2.
> > >
> > > And the problem starts here: when there is no TSC available to the
> > > kernel, whether because there is none provided by the CPU, or its
> > > support has been disabled in the kernel configuration (i.e.
> > > CONFIG_X86_TSC unset), then Xenomai uses the PIT to emulate a kind of
> > > poor man's TSC, so that it can eventually get a monotonic clock. To this
> > > end, Xenomai will also use the PIT's channel #2, as a free running
> > > counter. Hence the conflict with CONFIG_VT.
> > >
> > > But there is more: On x86, Xenomai also uses the PIT's channels #0 and
> > > #1 when undergoing the oneshot timing mode, exclusively for kernel
> > > configurations which do not provide APIC support (i.e.
> > > CONFIG_X86_LOCAL_APIC unset, because none of CONFIG_X86_UP_APIC and
> > > CONFIG_SMP are set). In such a case, the PC speaker management code
> > > generating the tone will badly conflict with the Xenomai system timer
> > > too, causing all sorts of erratic behaviours, since both step on each
> > > other's toes when programming the PIT's channel #0.
> > >
> > > With Linux 2.4, the sound generator is reached through a callback
> > > pointer, so Xenomai just routes the latter to a dummy routine, and we
> > > are done. With Linux 2.6, the callback has disappeared from the vanilla
> > > kernel, and sound event requests are sent to the input sub-system for
> > > processing, where we have currently no hack to void them. This is the
> > > reason why disabling CONFIG_VT entirely is recommended when there is a
> > > risk of conflict (which is rather drastic, I agree).
> > >
> > > To sum up:
> > > - The CONFIG_VT issue is in fact a conflict between the regular PC
> > > speaker code and Xenomai.
> > > - It is strictly a x86 issue.
> > > - It is automatically solved by Xenomai over Linux 2.4, and should be
> > > solved by disabling CONFIG_VT entirely over Linux 2.6 for configurations
> > > which do not provide APIC or even TSC support, at least until Adeos
> > > eventually silences this code, on demand, to help us.
> > >
> > > Since you have a P4, you do have a local APIC on your chip, so you
> > > should enable it for a uni-processor configuration (CONFIG_X86_UP_APIC),
> > > since it has far better performances latency-wise than the legacy
> > > programmable interrupt controller. You also have a TSC, and the kernel
> > > should use it automatically, provided the P4 CPU is properly selected in
> > > your kernel configuration, as Jan pointed out.
> > > With this configuration, you should not have to care about CONFIG_VT
> > > anymore.
> > >
> > >
> > Ok I try to sum up the points to see if I understand your explanation right:
> > On an x86 architecture xenomai uses the PIT to emulate a tsc,
>
> and provide oneshot timing support,
>
> > but the
> > PIT is also used by the VT to generate the speaker tone. And if I don't
> > disable CONFIG_VT, or the Linux speaker code, things get messed up.
> > But If I had an pentium architecture where tsc is provided, xenomai can
> > take care of this and directly uses the tsc supported by the pentium
> > chip, assumed that the kernel
> > is configured to a pentium.
> > Am I right, could you ack this?
> >
>
> Ack.
... provided you also enable CONFIG_X86_LOCAL_APIC for solving the
oneshot timing issue.
>
> > Regards,
> > Steve
> >
--
Philippe.
next prev parent reply other threads:[~2006-08-27 14:25 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-07 14:42 [Xenomai-help] Problems with rt_task_wait_period Steve Kreyer
2006-08-07 15:27 ` Jan Kiszka
2006-08-07 15:32 ` Philippe Gerum
2006-08-25 15:31 ` [Xenomai-help] Timer problems? Steve Kreyer
2006-08-25 17:47 ` Jan Kiszka
2006-08-26 20:34 ` Steve Kreyer
2006-08-27 10:38 ` Jan Kiszka
2006-08-27 12:08 ` Philippe Gerum
2006-08-27 12:24 ` Bernhard Walle
2006-08-28 14:46 ` Philippe Gerum
2006-08-27 12:34 ` Gilles Chanteperdrix
2006-08-27 13:02 ` Philippe Gerum
2006-08-27 13:56 ` Jan Kiszka
2006-08-27 13:47 ` Steve Kreyer
2006-08-27 14:22 ` Philippe Gerum
2006-08-27 14:25 ` Philippe Gerum [this message]
2006-08-27 14:45 ` Steve Kreyer
[not found] ` <44F196A0.2030006@domain.hid>
2006-08-27 13:00 ` Steve Kreyer
2006-08-25 17:57 ` [Xenomai-help] " Bernhard Walle
2006-08-26 21:23 ` Steve Kreyer
2006-08-26 21:38 ` Bernhard Walle
2006-08-26 22:12 ` Philippe Gerum
2006-08-27 9:21 ` Steve Kreyer
2006-08-27 9:34 ` Philippe Gerum
2006-08-27 10:31 ` Gilles Chanteperdrix
2006-08-27 9:27 ` Steve Kreyer
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=1156688736.4325.80.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=jan.kiszka@domain.hid \
--cc=steve.kreyer@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.