All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Rossier <daniel.rossier@domain.hid>
To: rpm@xenomai.org
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Xenomai on Xscale (Linux 2.6.20)
Date: Fri, 12 Oct 2007 14:28:45 +0200	[thread overview]
Message-ID: <470F687D.5060501@domain.hid> (raw)
In-Reply-To: <1192122000.6118.21.camel@domain.hid>

Philippe Gerum wrote:
>  On Thu, 2007-10-11 at 18:35 +0200, ROSSIER Daniel wrote:
> > Hi everyone,
> >
> > I'm taking over the original thread from Patrick concerning the
> > port of Xenomai on Xscale with Linux 2.6.20. Briefly summarized,
> > the boot process actually freezes after a while right after the
> > nucleus has been started.
> >
> > I've investigated the issue over the last hours, and I came up with
> > the following conclusion: it seems that the problem is due to a
> > endless loop in do_gettimeofday in arch/arm/kernel/time.c. Here is
> > the code:
> >
> > "... do { seq = read_seqbegin_irqsave(&xtime_lock, flags); usec =
> > system_timer->offset(); sec = xtime.tv_sec; usec += xtime.tv_nsec /
> > 1000; } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
> > ..."
> >
> > If I remove the do { } while loop with the call to
> > read_seqbegin_irqsave(), then the boot process is going ahead (I
> > got a suspicious error like "I-pipe: Detected illicit call from
> > domain 'Xenomai' " but it might well be normal with such a
> > modification.
> >
> > I checked with the code from a 2.6.15 kernel, and it is basically
> > the same structure.
> >
> > Any idea about the cause of this problem?
> >
>
>  That's typical of someone from the real-time (Xenomai) domain
>  spuriously calling into this routine, which is illegal.
>
>  The usual scenario for the lockup to happen is: - Linux task A calls
>  into some code grabbing the xtime lock for writing - Xenomai preempts
>  task A before it releases the seqlock, e.g. to process an interrupt -
>  some code on behalf of the Xenomai IRQ handler calls into
>  do_gettimeofday, which is wrong - the culprit gets a reader lock
>  sequence token, which will never match the quiescent state. This will
>  cause an infinite loop, since task A can't get out the critical
>  section to put the sequence in a quiescent state again, until the
>  Xenomai code relinquishes the CPU. Catch #22.
>
>  You likely need to chase the code who triggers the "Detected illicit
>  domain" message, likely in some code also calling do_gettimeofday().
>

Ok I'll do it. What I find weird is that the the do_gettimeofday() is 
called by xnpod_start_timer(kernel/xenomai/nucleus/pod.c). It is 
therefore called from the RT domain
but at the initialization time. My interpretation is that the timer 
interrupts arrived during the invokation
of xnpod_start_timer(), which are propagated to the Linux domain. There, 
the timer handler
is probably accessing do_gettimeofday() - to be proved - before the 
xnarch_start_timer() has finished, which may (but should not) lead to a 
potential deadend...

> > I checked the timer IRQs and other pipeline activity, and
> > everything seems to be OK. By the way, if I disable the nucleus,
> > Linux is working properly (timer not being stolen by I-pipe).
> >
> > Thanks in advance for any help.
> >
> > Cheers Daniel
> >
> > _______________________________________________ Xenomai-core
> > mailing list Xenomai-core@domain.hid
> > https://mail.gna.org/listinfo/xenomai-core

Daniel





  reply	other threads:[~2007-10-12 12:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11 16:35 [Xenomai-core] Xenomai on Xscale (Linux 2.6.20) ROSSIER Daniel
2007-10-11 17:00 ` Philippe Gerum
2007-10-12 12:28   ` Daniel Rossier [this message]
2007-10-12 12:43     ` Gilles Chanteperdrix
2007-10-11 17:02 ` Jan Kiszka
2007-10-12 11:48   ` Daniel Rossier
2007-10-12 12:34     ` Gilles Chanteperdrix
2007-10-12 12:46       ` Daniel Rossier
2007-10-12 13:14         ` Gilles Chanteperdrix
2007-10-13 15:34           ` ROSSIER Daniel
2007-10-13 17:06             ` Gilles Chanteperdrix
2007-10-22 16:38           ` Patrick
  -- strict thread matches above, loose matches on Subject: below --
2007-10-22 16:53 Patrick
2007-10-22 17:07 ` Jan Kiszka
2007-10-22 19:36 ` Gilles Chanteperdrix
2007-10-24 14:55 ROSSIER Daniel
2007-10-24 15:30 ` Philippe Gerum
2007-10-24 16:25   ` Gilles Chanteperdrix
2007-10-24 16:45     ` Philippe Gerum
2007-12-03 11:56       ` linux
2007-12-03 13:09         ` Gilles Chanteperdrix
2007-12-03 14:36         ` Patrick
2007-10-24 15:56 ` Gilles Chanteperdrix

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=470F687D.5060501@domain.hid \
    --to=daniel.rossier@domain.hid \
    --cc=rpm@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.