kernel panic when usb otg is attached

Hi,
I'm trying to compile a custom kernel (linux-omap-psp-2.6.32) using
openembedded. I successfully run
bitbake -c menuconfig virtual/kernel
bitbake -c compile virtual/kernel ; bitbake -c deploy virtual/kernel
bitbake base-image

Then I copied the image (the kernel image I used is
uImage-beagleboard.multi-config-cpuidle) into my sd card and booted
the board. But if I try to power the board only through usb, I obtain
the following kernel panic:

[ 16.674591] Unable to handle kernel NULL pointer dereference at
virtual address 00000014
[ 16.682739] pgd = c0004000
[ 16.685455] [00000014] *pgd=00000000
[ 16.689056] Internal error: Oops: 5 [#1] PREEMPT
[ 16.693695] last sysfs file:
[ 16.696685] Modules linked in:
[ 16.699768] CPU: 0 Tainted: G W (2.6.32 #0)
[ 16.705017] PC is at musb_interrupt+0x9f8/0xbb8
[ 16.709594] LR is at musb_interrupt+0x9e4/0xbb8
[ 16.714141] pc : [<c033e794>] lr : [<c033e780>] psr: 600001d3
[ 16.714141] sp : c0625ea0 ip : c0625ed8 fp : 000000f0
[ 16.725677] r10: 00000000 r9 : 00000099 r8 : 00000009
[ 16.730926] r7 : 00000000 r6 : cf82f108 r5 : 00000001 r4 : 00000000
[ 16.737487] r3 : 00000000 r2 : 00000000 r1 : fa0ab000 r0 : cf82f108
[ 16.744049] Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM
Segment kernel
[ 16.751586] Control: 10c5387d Table: 80004019 DAC: 00000017
[ 16.757354] Process swapper (pid: 0, stack limit = 0xc06242f0)
[ 16.763214] Stack: (0xc0625ea0 to 0xc0626000)
[ 16.767608] 5ea0: c0625ed8 00000002 2b971b6d 00000000 2b4e76c8
cf82f108 60000153 cf8a1940
[ 16.775817] 5ec0: c0624000 0000005c 00000000 00000000 c066c1c0
c033e9b8 c0625f08 cf8a1940
[ 16.784057] 5ee0: c0639550 c00a3b54 00000000 cf8a1940 c0639550
0000005c 00000002 00000001
[ 16.792266] 5f00: c0624000 0000001f 00000000 c00a5c4c 0000005c
00000000 c0670bb8 c003b074
[ 16.800506] 5f20: 00000000 ffffffff fa200000 c003bb44 00306dc4
00000000 00306dc4 00000000
[ 16.808715] 5f40: 00000003 00000003 c0670bb8 c0670c98 c0670c9c
411fc083 0000001f 00000000
[ 16.816955] 5f60: 3b9ac9ff c0625f78 c004c4c4 c004c4d0 60000053
ffffffff 00000000 00306dc4
[ 16.825164] 5f80: 00000002 2b971b6d 00000002 2b66ada9 c062a9f0
c0627fe0 c062a920 c06c43b4
[ 16.833404] 5fa0: 8002f234 c0385644 c06701cc c0624000 c0627fe0
c0627e84 c06701cc c003cfa4
[ 16.841613] 5fc0: 00000000 c06b73a0 c0670190 c0031010 c0627e78
c0008984 c0008498 00000000
[ 16.849853] 5fe0: 00000000 c0031010 10c53c7d c0670220 c0031414
80008034 00000000 00000000
[ 16.858093] [<c033e794>] (musb_interrupt+0x9f8/0xbb8) from
[<c033e9b8>] (generic_interrupt+0x)
[ 16.867370] [<c033e9b8>] (generic_interrupt+0x64/0x98) from
[<c00a3b54>] (handle_IRQ_event+0x)
[ 16.876739] [<c00a3b54>] (handle_IRQ_event+0xac/0x1ec) from
[<c00a5c4c>] (handle_level_irq+0x)
[ 16.886108] [<c00a5c4c>] (handle_level_irq+0xbc/0x148) from
[<c003b074>] (asm_do_IRQ+0x74/0x9)
[ 16.894866] [<c003b074>] (asm_do_IRQ+0x74/0x98) from [<c003bb44>]
(__irq_svc+0x44/0xa8)
[ 16.902893] Exception stack(0xc0625f30 to 0xc0625f78)
[ 16.907989] 5f20: 00306dc4
00000000 00306dc4 00000000
[ 16.916198] 5f40: 00000003 00000003 c0670bb8 c0670c98 c0670c9c
411fc083 0000001f 00000000
[ 16.924438] 5f60: 3b9ac9ff c0625f78 c004c4c4 c004c4d0 60000053 ffffffff
[ 16.931091] [<c003bb44>] (__irq_svc+0x44/0xa8) from [<c004c4d0>]
(omap3_enter_idle+0x108/0x14)
[ 16.939849] [<c004c4d0>] (omap3_enter_idle+0x108/0x140) from
[<c0385644>] (cpuidle_idle_call+)
[ 16.949401] [<c0385644>] (cpuidle_idle_call+0xa4/0x184) from
[<c003cfa4>] (cpu_idle+0x58/0xb8)
[ 16.958068] [<c003cfa4>] (cpu_idle+0x58/0xb8) from [<c0008984>]
(start_kernel+0x26c/0x2d8)
[ 16.966369] [<c0008984>] (start_kernel+0x26c/0x2d8) from
[<80008034>] (0x80008034)
[ 16.973999] Code: e3530003 13a02000 05963078 05933018 (05d33014)
[ 16.980194] ---[ end trace 2dcfe4fde02b5c19 ]---
[ 16.984863] Kernel panic - not syncing: Fatal exception in interrupt

I knew that this could be an issue related to insufficient power
provided by usb, so I powered the board via external vcc, and it
successfully boots.
The problem is that, whenever I attach the usb, I obtain a similar kernel panic:

Unable to handle kernel NULL pointer dereference at virtual a4
[ 41.776611] pgd = c0004000
[ 41.779327] [00000014] *pgd=00000000
[ 41.782928] Internal error: Oops: 17 [#1] PREEMPT
[ 41.787658] last sysfs file:
/sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:aaaa/bloe
[ 41.797973] Modules linked in: minix
[ 41.801574] CPU: 0 Tainted: G W (2.6.32 #0)
[ 41.806854] PC is at musb_interrupt+0x9f8/0xbb8
[ 41.811401] LR is at musb_interrupt+0x9e4/0xbb8
[ 41.815979] pc : [<c033e794>] lr : [<c033e780>] psr: 600001d3
[ 41.815979] sp : c0625ea0 ip : c0625ed8 fp : 000000f0
[ 41.827514] r10: 00000000 r9 : 00000099 r8 : 00000009
[ 41.832763] r7 : 00000000 r6 : cf82f108 r5 : 00000001 r4 : 00000000
[ 41.839324] r3 : 00000000 r2 : 00000000 r1 : fa0ab000 r0 : cf82f108
[ 41.845886] Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM
Segment kernel
[ 41.853393] Control: 10c5387d Table: 8fb54019 DAC: 00000017
[ 41.859191] Process swapper (pid: 0, stack limit = 0xc06242f0)
[ 41.865051] Stack: (0xc0625ea0 to 0xc0626000)
[ 41.869415] 5ea0: c0625ed8 0000001c 12ab9672 00000000 12785ead
cf82f108 60000153 cf8a1940
[ 41.877655] 5ec0: c0624000 0000005c 00000000 00000000 c066c1c0
c033e9b8 c0625f08 cf8a1940
[ 41.885864] 5ee0: c0639550 c00a3b54 00000000 cf8a1940 c0639550
0000005c 00000002 00000001
[ 41.894104] 5f00: c0624000 0000001f 00000000 c00a5c4c 0000005c
00000000 c0670bb8 c003b074
[ 41.902313] 5f20: 00000000 ffffffff fa200000 c003bb44 00051f2d
00000000 00051f2d 00000000
[ 41.910552] 5f40: 00000003 00000003 c0670bb8 c0670c98 c0670c9c
411fc083 0000001f 00000000
[ 41.918762] 5f60: 3b9ac9ff c0625f78 c004c4c4 c004c4d0 60000053
ffffffff 00000000 00051f2d
[ 41.927001] 5f80: 4cf3859f 116d8a80 4cf3859f 11686b53 c062ab10
c0627fe0 c062a920 c06c43b4
[ 41.935211] 5fa0: 8002f234 c0385644 c06701cc c0624000 c0627fe0
c0627e84 c06701cc c003cfa4
[ 41.943450] 5fc0: 00000000 c06b73a0 c0670190 c0031010 c0627e78
c0008984 c0008498 00000000
[ 41.951660] 5fe0: 00000000 c0031010 10c53c7d c0670220 c0031414
80008034 00000000 00000000
[ 41.959899] [<c033e794>] (musb_interrupt+0x9f8/0xbb8) from
[<c033e9b8>] (generic_interrupt+0x)
[ 41.969207] [<c033e9b8>] (generic_interrupt+0x64/0x98) from
[<c00a3b54>] (handle_IRQ_event+0x)
[ 41.978546] [<c00a3b54>] (handle_IRQ_event+0xac/0x1ec) from
[<c00a5c4c>] (handle_level_irq+0x)
[ 41.987915] [<c00a5c4c>] (handle_level_irq+0xbc/0x148) from
[<c003b074>] (asm_do_IRQ+0x74/0x9)
[ 41.996673] [<c003b074>] (asm_do_IRQ+0x74/0x98) from [<c003bb44>]
(__irq_svc+0x44/0xa8)
[ 42.004730] Exception stack(0xc0625f30 to 0xc0625f78)
[ 42.009796] 5f20: 00051f2d
00000000 00051f2d 00000000
[ 42.018035] 5f40: 00000003 00000003 c0670bb8 c0670c98 c0670c9c
411fc083 0000001f 00000000
[ 42.026245] 5f60: 3b9ac9ff c0625f78 c004c4c4 c004c4d0 60000053 ffffffff
[ 42.032928] [<c003bb44>] (__irq_svc+0x44/0xa8) from [<c004c4d0>]
(omap3_enter_idle+0x108/0x14)
[ 42.041687] [<c004c4d0>] (omap3_enter_idle+0x108/0x140) from
[<c0385644>] (cpuidle_idle_call+)
[ 42.051239] [<c0385644>] (cpuidle_idle_call+0xa4/0x184) from
[<c003cfa4>] (cpu_idle+0x58/0xb8)
[ 42.059906] [<c003cfa4>] (cpu_idle+0x58/0xb8) from [<c0008984>]
(start_kernel+0x26c/0x2d8)
[ 42.068206] [<c0008984>] (start_kernel+0x26c/0x2d8) from
[<80008034>] (0x80008034)
[ 42.075836] Code: e3530003 13a02000 05963078 05933018 (05d33014)
[ 42.082000] ---[ end trace ee02d25607460bb0 ]---
[ 42.086639] Kernel panic - not syncing: Fatal exception in interrupt

It seems to be an musb-interrupt issue. Is there any kernel
configuration that is missed?

Thanks for help!

Daniele

Try to compile with OTG USB network modules included in the kernel.

You can use the config file that you find here

http://www.angstrom-distribution.org/demo/beagleboard/config-2.6.32-r90+gitra6bad4464f985fdd3bed72e1b82dcbfc004d7869-beagleboard.multi-config-cpuidle-gether.config

Hi,
now I've a slightly different problem. I used the kernel configuration
that you posted from the angstrom demo files. I've only customized one
gpio configuration i need for my project.
Now the kernel boots correctly only when powered with external 5V
supply, but it panics when otg is attached at boot time. Then, if the
kernel finishes booting and I attach otg, it goes well.
It is a strange behavior since if I use the angstrom demo image the
otg-powered boot runs correctly...
I need this feature because beagle is used as an embedded device in my
application, so I can't use a console to check the angstrom boot
process...
please help
Thanks

Daniele

UPDATE.
Now my kernel configuration runs. Maybe the last error was due to the
beagleboard.multi-config-cpuidle.config that I used instead of
beagleboard.multi-config-cpuidle-gether.config.
My only problem now is that the
beagleboard.multi-config-cpuidle-gether.config configuration does not
allow any other usb gadget driver to be executed, while my purpose is
to develop my own usb gadget driver... Maybe configuring the kernel
with "Multifunction Composite Gadget", instead of g_ether only, could
be a solution?
Thanks in advance,

Daniele