From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: ROSSIER Daniel <Daniel.Rossier@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Xenomai on Xscale (Linux 2.6.20)
Date: Sat, 13 Oct 2007 19:06:51 +0200 [thread overview]
Message-ID: <18192.64299.835305.465602@domain.hid> (raw)
In-Reply-To: <FDBBB5CC70676540B3EF7CFE83FD94E0B4760D@EINT11.einet.ad.eivd.ch>
ROSSIER Daniel wrote:
>
> On Fri, 2007-10-12 at 15:14 +0200, Gilles Chanteperdrix wrote:
> On 10/12/07, Daniel Rossier <daniel.rossier@domain.hid> wrote:
> > > Gilles Chanteperdrix wrote:
> > > > On 10/12/07, Daniel Rossier <daniel.rossier@domain.hid> wrote:
> > > > > Jan Kiszka wrote:
> > > > >> 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.
> > > > >> Please post the full oops about that "illicit call". It may point
> > > > >> to an otherwise hidden invalid usage of Linux services over the
> > > > >> Xenomai domain and explain the lock-up.
> > > > > Sure; here is the output message: " I-pipe: Detected illicit call
> > > > > from domain 'Xenomai' into a service reserved for domain 'Linux'
> > > > > and below. [<c0027328>] (show_stack+0x0/0x40) from [<c005d590>]
> > > > > (ipipe_check_context+0x88/0xa4) [<c005d508>]
> > > > > (ipipe_check_context+0x0/0xa4) from [<c002d9e4>]
> > > > > (__ipipe_mach_set_dec+0x24/0x7c) r5 = 54503BD0 r4 = 00003029
> > > > > [<c002d9c0>] (__ipipe_mach_set_dec+0x0/0x7c) from [<c00681e0>]
> > > > > (xntimer_do_tick_aperiodic+0x2f4/0x33c) r4 = 00003029
> > > >
> > > > This does not make sense, __ipipe_mach_set_dec is a very simple
> > > > function that should not trigger this illicit call.
> > > >
> > >
> > > Exactly Gilles! Now I solved this bug. Having a look at the
> > > __ipipe_mach_set_dec() showed me
> > > an invokation to write_seqlock(&xtime_lock) !! I don't know why...
> > >
> > > As Philippe said, it is not allowed. I changed with
> > > local_irq_save_hw(flags) (as it is in the 2.6.15) and there is no
> > > deadlock anymore...
> >
> > I read I-pipe 2.6.20 arm 1.7-06, and there is no
> > write_seq_lock(&xtime_lock) either. Are you sure the patch applied
> > cleanly ?
> >
> >
> >
> Yeap! Shame on me. I had to go to fast with manipulations and pasted a wrong line. BUT, I found the real bug, and this time I checked with the original patch ;-). (btw, everything was coherent in the bug tracking, small consolation!)
>
> Now, there is actually a mistake in arch/arm/mach-pxa/time.c
> The __ipipe_mach_get_tsc() function failed because a bad declaration of "union tsc_reg". The two fields (long high, long low) have been decomposed with an intermediate short mid field. The PXA version of get_tsc() function does not use the "mid" field as it is the case with the AT91 version of get_tsc() from the at91 processor.
>
> Hence, I simply put the two high/low fields as two longs, and it works.
>
> Here is the new version of this type:
>
> union tsc_reg {
> #ifdef __BIG_ENDIAN
> struct {
> unsigned long high;
> /*unsigned short mid;*/
> /*unsigned short low;*/
> unsigned long low;
> };
> #else /* __LITTLE_ENDIAN */
> struct {
> unsigned long low;
> /*unsigned short low;*/
> /*unsigned short mid;*/
> unsigned long high;
> };
> #endif /* __LITTLE_ENDIAN */
> unsigned long long full;
> };
adeos-ipipe-2.6.20-arm-1.7-05 had this problem, it is solved in
adeos-ipipe-2.6.20-arm-1.7-06.
--
Gilles Chanteperdrix.
next prev parent reply other threads:[~2007-10-13 17:06 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
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 [this message]
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=18192.64299.835305.465602@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=Daniel.Rossier@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.