From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: GP Orcullo <kinsamanka@gmail.com>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] ODROID-U3 porting problems
Date: Sat, 30 Aug 2014 03:11:15 +0200 [thread overview]
Message-ID: <540124B3.9000706@xenomai.org> (raw)
In-Reply-To: <CACreCVKEyocU22ns2dURJxB-=mhTPqtEw62oEOo+edB4ZLDK9w@mail.gmail.com>
On 08/30/2014 02:17 AM, GP Orcullo wrote:
> On Fri, Aug 29, 2014 at 2:34 AM, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>> On 08/28/2014 07:05 PM, GP Orcullo wrote:
>>> On Fri, Aug 29, 2014 at 12:40 AM, Gilles Chanteperdrix
>>> <gilles.chanteperdrix@xenomai.org> wrote:
>>>> On 08/28/2014 06:34 PM, GP Orcullo wrote:
>>>>> So far it passes all the regression tests except for the switchtest.
>>>>
>>>> What error do you get with switchtest ? If pthread_create fails with
>>>> resource unavailable error, see:
>>>>
>>>> http://xenomai.org/troubleshooting-a-dual-kernel-configuration/#pthread_create_Resource_temporarily_unavailable
>>>>
>>>> If this is another error, please post the error message and kernel log here.
>>>>
>>>> --
>>>> Gilles.
>>>
>>> Running "switchtest rtk0" fails with "Xenomai: suspending kernel
>>> thread f00bb710 ('rtk1/0') at 0xc0020c8c after exception #0x0"
>>>
>>> The address is traced to the I-pipe timer interrupt call-back. I think
>>> I maybe missing some spinlocks somewhere.
>>
>> If you are using per-cpu hardware timers, no spinlock is needed, since
>> each cpu accesses its own timer. If you are using the same (hardware)
>> timer on several cpus, then it is not going to work anyway, Xenomai
>> wants one hardware timer per cpu.
>>
>> --
>> Gilles.
>
> I'm using the mct per-cpu hw timers and it's actually similar to
> smp_twd except that the base address is different for each cpu. The
> code where switch test fails is on the tick acknowledgement:
>
> [ 224.612412] Xenomai: suspending kernel thread f00d7710 ('rtk1/3')
> at 0xc0020c8c after exception #0x0
>
> static void mct_tick_ack(void)
> {
> c0020c6c: e92d4008 push {r3, lr}
> struct mct_clock_event_device *mevt = this_cpu_ptr(&percpu_mct_tick);
> c0020c70: eb092cf5 bl c026c04c <debug_smp_processor_id>
> c0020c74: e3022908 movw r2, #10504 ; 0x2908
> c0020c78: e34c2064 movt r2, #49252 ; 0xc064
> c0020c7c: e30b3570 movw r3, #46448 ; 0xb570
> c0020c80: e34c3061 movt r3, #49249 ; 0xc061
>
> exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET);
> c0020c84: e7922100 ldr r2, [r2, r0, lsl #2]
> c0020c88: e3a00001 mov r0, #1
> c0020c8c: e0823003 add r3, r2, r3
> c0020c90: e5931004 ldr r1, [r3, #4]
> c0020c94: e2811030 add r1, r1, #48 ; 0x30
> }
> c0020c98: e8bd4008 pop {r3, lr}
>
> static void mct_tick_ack(void)
> {
> struct mct_clock_event_device *mevt = this_cpu_ptr(&percpu_mct_tick);
>
> exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET);
> c0020c9c: eaffff8a b c0020acc <exynos4_mct_write>
>
>
> Writing to the mct registers is a bit slow I think this is the reason
> why the switch test fails:
No, the problem is using smp_processor_id() over a xenomai kernel
thread, it can not work.
Normally, this should not happen. arch/arm/include/asm/percpu.h defines
__my_cpu_offset not to use smp_processor_id(), so this_cpu_ptr should
not use smp_processor_id. You have to figure out why __my_cpu_offset
does not get defined in arch/arm/include/asm/percpu.h
--
Gilles.
next prev parent reply other threads:[~2014-08-30 1:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 13:49 [Xenomai] ODROID-U3 porting problems GP Orcullo
2014-08-27 15:45 ` Gilles Chanteperdrix
2014-08-27 17:14 ` Gilles Chanteperdrix
2014-08-28 13:45 ` GP Orcullo
2014-08-28 13:51 ` Gilles Chanteperdrix
2014-08-28 15:12 ` Poole Jr, Donald R.
2014-08-28 16:34 ` GP Orcullo
2014-08-28 16:40 ` Gilles Chanteperdrix
2014-08-28 17:05 ` GP Orcullo
2014-08-28 18:34 ` Gilles Chanteperdrix
2014-08-30 0:17 ` GP Orcullo
2014-08-30 1:11 ` Gilles Chanteperdrix [this message]
2014-08-30 2:22 ` Gilles Chanteperdrix
2014-08-30 2:40 ` GP Orcullo
2014-08-29 23:13 ` Alexandre Donisete Bensi
2014-08-30 0:50 ` GP Orcullo
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=540124B3.9000706@xenomai.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=kinsamanka@gmail.com \
--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.