* [Xenomai-core] kernel BUG running cyclictest on powerpc 405
@ 2007-10-25 14:24 Steven A. Falco
2007-10-25 14:41 ` Philippe Gerum
0 siblings, 1 reply; 5+ messages in thread
From: Steven A. Falco @ 2007-10-25 14:24 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 2517 bytes --]
I have built a 2.6.23-rc7 kernel (from Denx git) with Xenomai 2.4-rc3.
Architecture is powerpc, processor is a 405GP.
I had to make some additions to arch/powerpc/kernel/head_40x.S, and I
can submit a patch if someone tells me where to post it.
However, while the kernel boots and runs, the xenomai user apps do not
work correctly. Specifically, when running cyclictest, I get the following:
# ./cyclictest
0.00 0.00 0.00 1/18 668
T: 0 ( 668) P:99 I: ------------[ cut here ]------------ 0
Avg: 0 Max:-1000000
1000 C: 5kernel BUG at
/n/maytag/home/sfalco/linux/embedded/ppc3/linux/linux-2.6-denx/kernel/ipipe/core.c:314!
Min: 24 AcOops: Exception in kernel mode, sig: 5 [#1]
Netdec
Modules linked in:
NIP: c0045dd0 LR: c0015750 CTR: c00121fc
REGS: c0dbde00 TRAP: 0700 Not tainted (2.6.23-rc7)
MSR: 00021030 <ME,IR,DR> CR: 22000422 XER: 20000000
TASK = c0fe7420[668] 'cyclictest' THREAD: c0dbc000
GPR00: 00004900 c0dbdeb0 c0fe7420 00000000 003f0000 c00115dc
00000000 00000000
GPR08: 00000000 000048ff c0296090 00000001 00010000 1001c23c
00ff9900 00000001
GPR16: 7fbabcb0 10015090 10015068 00000000 0ff81940 00000000
0000029a 0ff815d0
GPR24: c02a2fcc 00000280 00000000 c030c200 0000001f 003f0000
00000010 c028e3bc
NIP [c0045dd0] __ipipe_restore_root+0x1c/0x50
LR [c0015750] uic_mask_irq+0x84/0x98
Call Trace:
[c0dbdeb0] [c0054cdc] hisyscall_event+0x1fc/0x310 (unreliable)
[c0dbded0] [c00439fc] __ipipe_ack_level_irq+0x50/0x78
[c0dbdee0] [c0007b2c] __ipipe_ack_irq+0x28/0x3c
[c0dbdef0] [c0007e68] __ipipe_handle_irq+0x12c/0x148
[c0dbdf20] [c00080f8] __ipipe_grab_irq+0x3c/0xc0
[c0dbdf40] [c000e338] __ipipe_ret_from_except+0x0/0xc
Instruction dump:
0.00 0.00 0.00 2/18 66Xenomai: POSIX: destroyed thread c0f803203d20c02c
8 004a78 3120ffff 7d690110 <0f0b0000> 2f830000 3d60c029
392b6050
t: 39 Avg: 29 Max: 39
T: 0 ( 668) P:99 I: 1000 C: 8 Min: 24 Act: 24
Avg: 29 Max: 39
Trace/breakpoint trap
The bug is coming from ipipe/core.c:314, which is the BUG_ON here:
void __ipipe_restore_root(unsigned long x)
{
BUG_ON(!ipipe_root_domain_p);
if (x)
__ipipe_stall_root();
else
__ipipe_unstall_root();
}
How do I debug this? I have done a little kernel hacking, but I am a
noob when it comes to Xenomai...
Steve
[-- Attachment #2: Type: text/html, Size: 3309 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] kernel BUG running cyclictest on powerpc 405
2007-10-25 14:24 [Xenomai-core] kernel BUG running cyclictest on powerpc 405 Steven A. Falco
@ 2007-10-25 14:41 ` Philippe Gerum
2007-10-25 14:45 ` Steven A. Falco
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Gerum @ 2007-10-25 14:41 UTC (permalink / raw)
To: Steven A. Falco; +Cc: xenomai
Steven A. Falco wrote:
> I have built a 2.6.23-rc7 kernel (from Denx git) with Xenomai 2.4-rc3.
> Architecture is powerpc, processor is a 405GP.
>
> I had to make some additions to arch/powerpc/kernel/head_40x.S, and I
> can submit a patch if someone tells me where to post it.
>
Here would be nice, or to the Adeos list, indifferently - I would pick
it from both anyway.
> However, while the kernel boots and runs, the xenomai user apps do not
> work correctly. Specifically, when running cyclictest, I get the following:
>
This patch should fix this issue.
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index eeb38e2..5a38086 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -48,7 +48,7 @@ struct uic {
int index;
int dcrbase;
- spinlock_t lock;
+ ipipe_spinlock_t lock;
/* The remapper for this UIC */
struct irq_host *irqhost;
>
> How do I debug this? I have done a little kernel hacking, but I am a
> noob when it comes to Xenomai...
>
Well, actually, it's shame on me. I did not notice that the universal
interrupt controller code was missing some bits in post-2.6.21 I-pipe
patches.
--
Philippe.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] kernel BUG running cyclictest on powerpc 405
2007-10-25 14:41 ` Philippe Gerum
@ 2007-10-25 14:45 ` Steven A. Falco
2007-10-25 15:02 ` Philippe Gerum
0 siblings, 1 reply; 5+ messages in thread
From: Steven A. Falco @ 2007-10-25 14:45 UTC (permalink / raw)
To: rpm; +Cc: xenomai
[-- Attachment #1.1: Type: text/plain, Size: 1388 bytes --]
Thanks! I'll try your patch and report if I still have trouble.
I've attached my patch for PPC405.
Steve
Philippe Gerum wrote:
> Steven A. Falco wrote:
>
>> I have built a 2.6.23-rc7 kernel (from Denx git) with Xenomai 2.4-rc3.
>> Architecture is powerpc, processor is a 405GP.
>>
>> I had to make some additions to arch/powerpc/kernel/head_40x.S, and I
>> can submit a patch if someone tells me where to post it.
>>
>>
>
> Here would be nice, or to the Adeos list, indifferently - I would pick
> it from both anyway.
>
>
>> However, while the kernel boots and runs, the xenomai user apps do not
>> work correctly. Specifically, when running cyclictest, I get the following:
>>
>>
>
> This patch should fix this issue.
>
> diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
> index eeb38e2..5a38086 100644
> --- a/arch/powerpc/sysdev/uic.c
> +++ b/arch/powerpc/sysdev/uic.c
> @@ -48,7 +48,7 @@ struct uic {
> int index;
> int dcrbase;
>
> - spinlock_t lock;
> + ipipe_spinlock_t lock;
>
> /* The remapper for this UIC */
> struct irq_host *irqhost;
>
>> How do I debug this? I have done a little kernel hacking, but I am a
>> noob when it comes to Xenomai...
>>
>>
>
> Well, actually, it's shame on me. I did not notice that the universal
> interrupt controller code was missing some bits in post-2.6.21 I-pipe
> patches.
>
>
[-- Attachment #1.2: Type: text/html, Size: 1942 bytes --]
[-- Attachment #2: ipipe.patch --]
[-- Type: text/x-patch, Size: 1334 bytes --]
--- linux-2.6-denx.xenomai/arch/powerpc/kernel/head_40x.S 2007-09-28 13:40:46.000000000 -0400
+++ linux-2.6-denx/arch/powerpc/kernel/head_40x.S 2007-10-24 14:02:23.000000000 -0400
@@ -227,6 +227,12 @@
EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \
ret_from_except_full)
+#ifdef CONFIG_IPIPE
+#define EXC_XFER_IPIPE(n, hdlr) \
+ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \
+ __ipipe_ret_from_except)
+#endif /* CONFIG_IPIPE */
+
#define EXC_XFER_LITE(n, hdlr) \
EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \
ret_from_except)
@@ -395,7 +401,11 @@
EXC_XFER_EE_LITE(0x400, handle_page_fault)
/* 0x0500 - External Interrupt Exception */
+#ifdef CONFIG_IPIPE
+ EXCEPTION(0x0500, HardwareInterrupt, __ipipe_grab_irq, EXC_XFER_IPIPE)
+#else /* !CONFIG_IPIPE */
EXCEPTION(0x0500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
+#endif /* CONFIG_IPIPE */
/* 0x0600 - Alignment Exception */
START_EXCEPTION(0x0600, Alignment)
@@ -433,7 +443,11 @@
lis r0,TSR_PIS@h
mtspr SPRN_TSR,r0 /* Clear the PIT exception */
addi r3,r1,STACK_FRAME_OVERHEAD
+#ifdef CONFIG_IPIPE
+ EXC_XFER_IPIPE(0x1000, __ipipe_grab_timer)
+#else /* !CONFIG_IPIPE */
EXC_XFER_LITE(0x1000, timer_interrupt)
+#endif /* CONFIG_IPIPE */
#if 0
/* NOTE:
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] kernel BUG running cyclictest on powerpc 405
2007-10-25 14:45 ` Steven A. Falco
@ 2007-10-25 15:02 ` Philippe Gerum
2007-10-25 17:16 ` Steven A. Falco
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Gerum @ 2007-10-25 15:02 UTC (permalink / raw)
To: Steven A. Falco; +Cc: xenomai
Steven A. Falco wrote:
> Thanks! I'll try your patch and report if I still have trouble.
>
> I've attached my patch for PPC405.
>
Thanks. You may also want to upgrade to this I-pipe patch; it should
apply properly against -rc7:
http://download.gna.org/adeos/patches/v2.6/powerpc/adeos-ipipe-2.6.23-powerpc-DENX-2.0-02.patch
You would still need the quick fix for the UIC on top of that one, though.
> Steve
>
> Philippe Gerum wrote:
>> Steven A. Falco wrote:
>>
>>> I have built a 2.6.23-rc7 kernel (from Denx git) with Xenomai 2.4-rc3.
>>> Architecture is powerpc, processor is a 405GP.
>>>
>>> I had to make some additions to arch/powerpc/kernel/head_40x.S, and I
>>> can submit a patch if someone tells me where to post it.
>>>
>>>
>>
>> Here would be nice, or to the Adeos list, indifferently - I would pick
>> it from both anyway.
>>
>>
>>> However, while the kernel boots and runs, the xenomai user apps do not
>>> work correctly. Specifically, when running cyclictest, I get the following:
>>>
>>>
>>
>> This patch should fix this issue.
>>
>> diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
>> index eeb38e2..5a38086 100644
>> --- a/arch/powerpc/sysdev/uic.c
>> +++ b/arch/powerpc/sysdev/uic.c
>> @@ -48,7 +48,7 @@ struct uic {
>> int index;
>> int dcrbase;
>>
>> - spinlock_t lock;
>> + ipipe_spinlock_t lock;
>>
>> /* The remapper for this UIC */
>> struct irq_host *irqhost;
>>
>>> How do I debug this? I have done a little kernel hacking, but I am a
>>> noob when it comes to Xenomai...
>>>
>>>
>>
>> Well, actually, it's shame on me. I did not notice that the universal
>> interrupt controller code was missing some bits in post-2.6.21 I-pipe
>> patches.
>>
>>
--
Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] kernel BUG running cyclictest on powerpc 405
2007-10-25 15:02 ` Philippe Gerum
@ 2007-10-25 17:16 ` Steven A. Falco
0 siblings, 0 replies; 5+ messages in thread
From: Steven A. Falco @ 2007-10-25 17:16 UTC (permalink / raw)
To: rpm; +Cc: xenomai
[-- Attachment #1.1: Type: text/plain, Size: 2833 bytes --]
I upgraded to the new ipipe patch and your uic fix. Attached is a new
patch I needed - without it, I get the error message:
.../include/linux/ipipe.h:298: warning: 'struct mm_struct' declared
inside parameter list
.../include/linux/ipipe.h:298: warning: its scope is only this
definition or declaration, which is probably not what you want
Also, there is a problem with the uic fix. It now gives this
compile-time error:
CC arch/powerpc/sysdev/uic.o
.../arch/powerpc/sysdev/uic.c: In function 'uic_init_one':
.../arch/powerpc/sysdev/uic.c:234: error: incompatible types in assignment
I believe this is caused by the definition in spinlock.h:
# define spin_lock_init(lock) \
do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0)
The SPIN_LOCK_UNLOCKED should perhaps be IPIPE_SPIN_LOCK_UNLOCKED, but I
don't know if this is the right way to fix it.
Steve
Philippe Gerum wrote:
> Steven A. Falco wrote:
>
>> Thanks! I'll try your patch and report if I still have trouble.
>>
>> I've attached my patch for PPC405.
>>
>>
>
> Thanks. You may also want to upgrade to this I-pipe patch; it should
> apply properly against -rc7:
>
> http://download.gna.org/adeos/patches/v2.6/powerpc/adeos-ipipe-2.6.23-powerpc-DENX-2.0-02.patch
>
> You would still need the quick fix for the UIC on top of that one, though.
>
>
>> Steve
>>
>> Philippe Gerum wrote:
>>
>>> Steven A. Falco wrote:
>>>
>>>
>>>> I have built a 2.6.23-rc7 kernel (from Denx git) with Xenomai 2.4-rc3.
>>>> Architecture is powerpc, processor is a 405GP.
>>>>
>>>> I had to make some additions to arch/powerpc/kernel/head_40x.S, and I
>>>> can submit a patch if someone tells me where to post it.
>>>>
>>>>
>>>>
>>> Here would be nice, or to the Adeos list, indifferently - I would pick
>>> it from both anyway.
>>>
>>>
>>>
>>>> However, while the kernel boots and runs, the xenomai user apps do not
>>>> work correctly. Specifically, when running cyclictest, I get the following:
>>>>
>>>>
>>>>
>>> This patch should fix this issue.
>>>
>>> diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
>>> index eeb38e2..5a38086 100644
>>> --- a/arch/powerpc/sysdev/uic.c
>>> +++ b/arch/powerpc/sysdev/uic.c
>>> @@ -48,7 +48,7 @@ struct uic {
>>> int index;
>>> int dcrbase;
>>>
>>> - spinlock_t lock;
>>> + ipipe_spinlock_t lock;
>>>
>>> /* The remapper for this UIC */
>>> struct irq_host *irqhost;
>>>
>>>
>>>> How do I debug this? I have done a little kernel hacking, but I am a
>>>> noob when it comes to Xenomai...
>>>>
>>>>
>>>>
>>> Well, actually, it's shame on me. I did not notice that the universal
>>> interrupt controller code was missing some bits in post-2.6.21 I-pipe
>>> patches.
>>>
>>>
>>>
>
>
>
[-- Attachment #1.2: Type: text/html, Size: 3723 bytes --]
[-- Attachment #2: fix.mm_struct --]
[-- Type: text/plain, Size: 292 bytes --]
--- /home/sfalco/ipipe.h 2007-10-25 12:59:12.000000000 -0400
+++ include/linux/ipipe.h 2007-10-25 12:59:23.000000000 -0400
@@ -31,6 +31,8 @@
#include <linux/ipipe_compat.h>
#include <asm/ipipe.h>
+struct mm_struct;
+
#ifdef CONFIG_IPIPE
#define IPIPE_VERSION_STRING IPIPE_ARCH_STRING
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-10-25 17:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-25 14:24 [Xenomai-core] kernel BUG running cyclictest on powerpc 405 Steven A. Falco
2007-10-25 14:41 ` Philippe Gerum
2007-10-25 14:45 ` Steven A. Falco
2007-10-25 15:02 ` Philippe Gerum
2007-10-25 17:16 ` Steven A. Falco
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.