All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5
  2012-08-06 10:12 [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5 Peiyong Feng
@ 2012-08-06 10:12 ` Felipe Balbi
  2012-08-06 13:14   ` Lukasz Majewski
  0 siblings, 1 reply; 9+ messages in thread
From: Felipe Balbi @ 2012-08-06 10:12 UTC (permalink / raw)
  To: Peiyong Feng; +Cc: balbi, linux-usb, linux-kernel, Lukasz Majewski

[-- Attachment #1: Type: text/plain, Size: 6798 bytes --]

Hi,

On Mon, Aug 06, 2012 at 06:12:05PM +0800, Peiyong Feng wrote:
> I got a kernel panic when try hsotg of ok6410 which is based on s3c6410:
> 
> 
> cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
> Unable to handle kernel NULL pointer dereference at virtual address 00000100
> pgd = c0004000
> [00000100] *pgd=00000000
> Internal error: Oops: 5 [#1] ARM
> Modules linked in:
> CPU: 0    Not tainted  (3.5.0 #9)
> PC is at s3c_hsotg_handle_outdone+0x44/0x158
> LR is at s3c_hsotg_irq+0x75c/0x804
> pc : [<c023e7fc>]    lr : [<c024061c>]    psr: 60000193
> sp : c782fd20  ip : 00000029  fp : c13a1460
> r10: 00000000  r9 : 00000008  r8 : 000000d0
> r7 : c13a1400  r6 : 00000002  r5 : 00000000  r4 : 00060002
> r3 : 000000d0  r2 : 00000000  r1 : 00080200  r0 : c13a1400
> Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> Control: 00c5387d  Table: 50004008  DAC: 00000017
> Process swapper (pid: 1, stack limit = 0xc782e268)
> Stack: (0xc782fd20 to 0xc7830000)
> fd20: c13a1460 c0200f64 00000000 00060002 00000000 00000002 c13a1400 00000010
> fd40: 00000000 c024061c 00060002 00000000 00000002 00000008 c782fda0 c139a5c0
> fd60: c139a5c0 00000000 00000000 0000005a c04cc52c c04cc594 c04ea5fe c00565c0
> fd80: 00000000 00000000 00000000 c04cc52c c139a5c0 c04cc57c 00000000 c04eb328
> fda0: c04cc55c c04eb324 c04c44c0 c0056768 c04cc52c c04cc57c 00000000 c0058d64
> fdc0: 0000005a c04d7dd8 00000000 c005617c 0000005a c000efbc c04eb350 00000001
> fde0: c782fe08 c000853c c036c540 60000013 ffffffff c782fe3c c04cc57c c04cc55c
> fe00: 60000013 c000dd80 c04cc57c c782c000 ffffffff 00000001 60000013 c04cc52c
> fe20: c139a5c0 0000005a c04cc57c c04cc55c 60000013 c04c44c0 f6010000 c782fe50
> fe40: c036c53c c036c540 60000013 ffffffff c023fec0 c00574c8 00000000 c008b2dc
> fe60: c023fec0 00000000 00000000 c13a1400 0000005a c139a5c0 c04cc52c c0057960
> fe80: 0000005a c13a1400 c04c44b8 00000000 c051d238 c049b0ec 00000000 c03688fc
> fea0: c7853e60 c13a1400 c7804f80 00000000 c04c44f4 60000013 c7855a80 00000000
> fec0: c04e1bb4 c04c44c0 c04c44c0 c04e1bb4 c04e1bb4 c051d238 c049b0ec 00000000
> fee0: c04eb040 c020588c c04c44c0 c0204524 c04c44c0 c04c44f4 c04e1bb4 c02046ac
> ff00: c13a01e0 c0204738 00000000 c782ff18 c04e1bb4 c0202e30 c7803878 c7823700
> ff20: c04dd1d0 c040b8d4 c04e1bb4 c04e1bb4 c04dd1d0 c0203600 c040b8d4 c01b8568
> ff40: 00000000 00000000 c04e1bb4 00000007 c04eb040 c782e000 c04a65e0 c0204ce8
> ff60: 00000000 c04a65d4 00000007 c04eb040 c782e000 c0008628 c04c7ea0 00000000
> ff80: 0000009c 00000000 c0625cf9 c0037178 00000006 00000006 c0461b84 c042cee8
> ffa0: c04c7ea0 c04abdd4 c04a65d4 00000007 c04eb040 0000009c c04841b0 c04a65e0
> ffc0: 00000000 c048430c 00000006 00000006 c04841b0 00000000 00000000 c048421c
> ffe0: c000f08c 00000013 00000000 00000000 00000000 c000f08c 00000000 00000000
> [<c023e7fc>] (s3c_hsotg_handle_outdone+0x44/0x158) from [<c024061c>]
> (s3c_hsotg_irq+0x75c/0x804)
> [<c024061c>] (s3c_hsotg_irq+0x75c/0x804) from [<c00565c0>]
> (handle_irq_event_percpu+0x50/0x1bc)
> [<c00565c0>] (handle_irq_event_percpu+0x50/0x1bc) from [<c0056768>]
> (handle_irq_event+0x3c/0x5c)
> [<c0056768>] (handle_irq_event+0x3c/0x5c) from [<c0058d64>]
> (handle_level_irq+0x8c/0x118)
> [<c0058d64>] (handle_level_irq+0x8c/0x118) from [<c005617c>]
> (generic_handle_irq+0x38/0x44)
> [<c005617c>] (generic_handle_irq+0x38/0x44) from [<c000efbc>]
> (handle_IRQ+0x30/0x84)
> [<c000efbc>] (handle_IRQ+0x30/0x84) from [<c000853c>] (vic_handle_irq+0x68/0xa8)
> [<c000853c>] (vic_handle_irq+0x68/0xa8) from [<c000dd80>] (__irq_svc+0x40/0x60)
> Exception stack(0xc782fe08 to 0xc782fe50)
> fe00:                   c04cc57c c782c000 ffffffff 00000001 60000013 c04cc52c
> fe20: c139a5c0 0000005a c04cc57c c04cc55c 60000013 c04c44c0 f6010000 c782fe50
> fe40: c036c53c c036c540 60000013 ffffffff
> [<c000dd80>] (__irq_svc+0x40/0x60) from [<c036c540>]
> (_raw_spin_unlock_irqrestore+0x10/0x14)
> [<c036c540>] (_raw_spin_unlock_irqrestore+0x10/0x14) from [<c00574c8>]
> (__setup_irq+0x178/0x3f8)
> [<c00574c8>] (__setup_irq+0x178/0x3f8) from [<c0057960>]
> (request_threaded_irq+0xc4/0x12c)
> [<c0057960>] (request_threaded_irq+0xc4/0x12c) from [<c03688fc>]
> (s3c_hsotg_probe+0x14c/0x700)
> [<c03688fc>] (s3c_hsotg_probe+0x14c/0x700) from [<c020588c>]
> (platform_drv_probe+0x18/0x1c)
> [<c020588c>] (platform_drv_probe+0x18/0x1c) from [<c0204524>]
> (driver_probe_device+0x78/0x200)
> [<c0204524>] (driver_probe_device+0x78/0x200) from [<c0204738>]
> (__driver_attach+0x8c/0x90)
> [<c0204738>] (__driver_attach+0x8c/0x90) from [<c0202e30>]
> (bus_for_each_dev+0x60/0x8c)
> [<c0202e30>] (bus_for_each_dev+0x60/0x8c) from [<c0203600>]
> (bus_add_driver+0xac/0x250)
> [<c0203600>] (bus_add_driver+0xac/0x250) from [<c0204ce8>]
> (driver_register+0x58/0x130)
> [<c0204ce8>] (driver_register+0x58/0x130) from [<c0008628>]
> (do_one_initcall+0x34/0x17c)
> [<c0008628>] (do_one_initcall+0x34/0x17c) from [<c048430c>]
> (kernel_init+0xf0/0x1bc)
> [<c048430c>] (kernel_init+0xf0/0x1bc) from [<c000f08c>]
> (kernel_thread_exit+0x0/0x8)
> Code: e0433106 e0833006 e1a03183 e0828003 (e5984030)
> ---[ end trace 2ea4e574318ecf99 ]---
> Kernel panic - not syncing: Fatal exception in interrupt
> -----------------------------------------------------------------------------------
> 
> 
> When I try locate the source using arm-linux-gdb, I got this:
> -------------------------------------------------------------
> GNU gdb (Sourcery G++ Lite 2008q3-72) 6.8.50.20080821-cvs
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=i686-pc-linux-gnu
> --target=arm-none-linux-gnueabi".
> For bug reporting instructions, please see:
> <https://support.codesourcery.com/GNUToolchain/>...
> (gdb) l *(s3c_hsotg_handle_outdone+0x44)
> 0xc023e7fc is in s3c_hsotg_handle_outdone (drivers/usb/gadget/s3c-hsotg.c:1553).
> 1548	static void s3c_hsotg_handle_outdone(struct s3c_hsotg *hsotg,
> 1549					     int epnum, bool was_setup)
> 1550	{
> 1551		u32 epsize = readl(hsotg->regs + DOEPTSIZ(epnum));
> 1552		struct s3c_hsotg_ep *hs_ep = &hsotg->eps[epnum];
> 1553		struct s3c_hsotg_req *hs_req = hs_ep->req;
> 1554		struct usb_request *req = &hs_req->req;
> 1555		unsigned size_left = DxEPTSIZ_XferSize_GET(epsize);
> 1556		int result = 0;
> 1557	
> (gdb)
> 
> 
> 
> I also try the old linux like 2.6.36, I works fine.

Lukasz, any ideas ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5
@ 2012-08-06 10:12 Peiyong Feng
  2012-08-06 10:12 ` Felipe Balbi
  0 siblings, 1 reply; 9+ messages in thread
From: Peiyong Feng @ 2012-08-06 10:12 UTC (permalink / raw)
  To: balbi, linux-usb, linux-kernel

I got a kernel panic when try hsotg of ok6410 which is based on s3c6410:


cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Unable to handle kernel NULL pointer dereference at virtual address 00000100
pgd = c0004000
[00000100] *pgd=00000000
Internal error: Oops: 5 [#1] ARM
Modules linked in:
CPU: 0    Not tainted  (3.5.0 #9)
PC is at s3c_hsotg_handle_outdone+0x44/0x158
LR is at s3c_hsotg_irq+0x75c/0x804
pc : [<c023e7fc>]    lr : [<c024061c>]    psr: 60000193
sp : c782fd20  ip : 00000029  fp : c13a1460
r10: 00000000  r9 : 00000008  r8 : 000000d0
r7 : c13a1400  r6 : 00000002  r5 : 00000000  r4 : 00060002
r3 : 000000d0  r2 : 00000000  r1 : 00080200  r0 : c13a1400
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 00c5387d  Table: 50004008  DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc782e268)
Stack: (0xc782fd20 to 0xc7830000)
fd20: c13a1460 c0200f64 00000000 00060002 00000000 00000002 c13a1400 00000010
fd40: 00000000 c024061c 00060002 00000000 00000002 00000008 c782fda0 c139a5c0
fd60: c139a5c0 00000000 00000000 0000005a c04cc52c c04cc594 c04ea5fe c00565c0
fd80: 00000000 00000000 00000000 c04cc52c c139a5c0 c04cc57c 00000000 c04eb328
fda0: c04cc55c c04eb324 c04c44c0 c0056768 c04cc52c c04cc57c 00000000 c0058d64
fdc0: 0000005a c04d7dd8 00000000 c005617c 0000005a c000efbc c04eb350 00000001
fde0: c782fe08 c000853c c036c540 60000013 ffffffff c782fe3c c04cc57c c04cc55c
fe00: 60000013 c000dd80 c04cc57c c782c000 ffffffff 00000001 60000013 c04cc52c
fe20: c139a5c0 0000005a c04cc57c c04cc55c 60000013 c04c44c0 f6010000 c782fe50
fe40: c036c53c c036c540 60000013 ffffffff c023fec0 c00574c8 00000000 c008b2dc
fe60: c023fec0 00000000 00000000 c13a1400 0000005a c139a5c0 c04cc52c c0057960
fe80: 0000005a c13a1400 c04c44b8 00000000 c051d238 c049b0ec 00000000 c03688fc
fea0: c7853e60 c13a1400 c7804f80 00000000 c04c44f4 60000013 c7855a80 00000000
fec0: c04e1bb4 c04c44c0 c04c44c0 c04e1bb4 c04e1bb4 c051d238 c049b0ec 00000000
fee0: c04eb040 c020588c c04c44c0 c0204524 c04c44c0 c04c44f4 c04e1bb4 c02046ac
ff00: c13a01e0 c0204738 00000000 c782ff18 c04e1bb4 c0202e30 c7803878 c7823700
ff20: c04dd1d0 c040b8d4 c04e1bb4 c04e1bb4 c04dd1d0 c0203600 c040b8d4 c01b8568
ff40: 00000000 00000000 c04e1bb4 00000007 c04eb040 c782e000 c04a65e0 c0204ce8
ff60: 00000000 c04a65d4 00000007 c04eb040 c782e000 c0008628 c04c7ea0 00000000
ff80: 0000009c 00000000 c0625cf9 c0037178 00000006 00000006 c0461b84 c042cee8
ffa0: c04c7ea0 c04abdd4 c04a65d4 00000007 c04eb040 0000009c c04841b0 c04a65e0
ffc0: 00000000 c048430c 00000006 00000006 c04841b0 00000000 00000000 c048421c
ffe0: c000f08c 00000013 00000000 00000000 00000000 c000f08c 00000000 00000000
[<c023e7fc>] (s3c_hsotg_handle_outdone+0x44/0x158) from [<c024061c>]
(s3c_hsotg_irq+0x75c/0x804)
[<c024061c>] (s3c_hsotg_irq+0x75c/0x804) from [<c00565c0>]
(handle_irq_event_percpu+0x50/0x1bc)
[<c00565c0>] (handle_irq_event_percpu+0x50/0x1bc) from [<c0056768>]
(handle_irq_event+0x3c/0x5c)
[<c0056768>] (handle_irq_event+0x3c/0x5c) from [<c0058d64>]
(handle_level_irq+0x8c/0x118)
[<c0058d64>] (handle_level_irq+0x8c/0x118) from [<c005617c>]
(generic_handle_irq+0x38/0x44)
[<c005617c>] (generic_handle_irq+0x38/0x44) from [<c000efbc>]
(handle_IRQ+0x30/0x84)
[<c000efbc>] (handle_IRQ+0x30/0x84) from [<c000853c>] (vic_handle_irq+0x68/0xa8)
[<c000853c>] (vic_handle_irq+0x68/0xa8) from [<c000dd80>] (__irq_svc+0x40/0x60)
Exception stack(0xc782fe08 to 0xc782fe50)
fe00:                   c04cc57c c782c000 ffffffff 00000001 60000013 c04cc52c
fe20: c139a5c0 0000005a c04cc57c c04cc55c 60000013 c04c44c0 f6010000 c782fe50
fe40: c036c53c c036c540 60000013 ffffffff
[<c000dd80>] (__irq_svc+0x40/0x60) from [<c036c540>]
(_raw_spin_unlock_irqrestore+0x10/0x14)
[<c036c540>] (_raw_spin_unlock_irqrestore+0x10/0x14) from [<c00574c8>]
(__setup_irq+0x178/0x3f8)
[<c00574c8>] (__setup_irq+0x178/0x3f8) from [<c0057960>]
(request_threaded_irq+0xc4/0x12c)
[<c0057960>] (request_threaded_irq+0xc4/0x12c) from [<c03688fc>]
(s3c_hsotg_probe+0x14c/0x700)
[<c03688fc>] (s3c_hsotg_probe+0x14c/0x700) from [<c020588c>]
(platform_drv_probe+0x18/0x1c)
[<c020588c>] (platform_drv_probe+0x18/0x1c) from [<c0204524>]
(driver_probe_device+0x78/0x200)
[<c0204524>] (driver_probe_device+0x78/0x200) from [<c0204738>]
(__driver_attach+0x8c/0x90)
[<c0204738>] (__driver_attach+0x8c/0x90) from [<c0202e30>]
(bus_for_each_dev+0x60/0x8c)
[<c0202e30>] (bus_for_each_dev+0x60/0x8c) from [<c0203600>]
(bus_add_driver+0xac/0x250)
[<c0203600>] (bus_add_driver+0xac/0x250) from [<c0204ce8>]
(driver_register+0x58/0x130)
[<c0204ce8>] (driver_register+0x58/0x130) from [<c0008628>]
(do_one_initcall+0x34/0x17c)
[<c0008628>] (do_one_initcall+0x34/0x17c) from [<c048430c>]
(kernel_init+0xf0/0x1bc)
[<c048430c>] (kernel_init+0xf0/0x1bc) from [<c000f08c>]
(kernel_thread_exit+0x0/0x8)
Code: e0433106 e0833006 e1a03183 e0828003 (e5984030)
---[ end trace 2ea4e574318ecf99 ]---
Kernel panic - not syncing: Fatal exception in interrupt
-----------------------------------------------------------------------------------


When I try locate the source using arm-linux-gdb, I got this:
-------------------------------------------------------------
GNU gdb (Sourcery G++ Lite 2008q3-72) 6.8.50.20080821-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=arm-none-linux-gnueabi".
For bug reporting instructions, please see:
<https://support.codesourcery.com/GNUToolchain/>...
(gdb) l *(s3c_hsotg_handle_outdone+0x44)
0xc023e7fc is in s3c_hsotg_handle_outdone (drivers/usb/gadget/s3c-hsotg.c:1553).
1548	static void s3c_hsotg_handle_outdone(struct s3c_hsotg *hsotg,
1549					     int epnum, bool was_setup)
1550	{
1551		u32 epsize = readl(hsotg->regs + DOEPTSIZ(epnum));
1552		struct s3c_hsotg_ep *hs_ep = &hsotg->eps[epnum];
1553		struct s3c_hsotg_req *hs_req = hs_ep->req;
1554		struct usb_request *req = &hs_req->req;
1555		unsigned size_left = DxEPTSIZ_XferSize_GET(epsize);
1556		int result = 0;
1557	
(gdb)



I also try the old linux like 2.6.36, I works fine.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5
  2012-08-06 10:12 ` Felipe Balbi
@ 2012-08-06 13:14   ` Lukasz Majewski
  2012-08-07  3:04     ` Peiyong Feng
  2012-08-07 16:34     ` Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Lukasz Majewski @ 2012-08-06 13:14 UTC (permalink / raw)
  To: balbi, Peiyong Feng; +Cc: linux-usb, linux-kernel

Hi,

> Hi,
> 
> On Mon, Aug 06, 2012 at 06:12:05PM +0800, Peiyong Feng wrote:
> > I got a kernel panic when try hsotg of ok6410 which is based on
> > s3c6410:
As you said, you are using the ok6410. And it is "based" on the s3c6410
CPU. S3C6410 is a single core CPU. I assume that ok6410 is also single
core?

> > 
> > 
> > cdc_acm: USB Abstract Control Model driver for USB modems and ISDN
> > adapters Unable to handle kernel NULL pointer dereference at
> > virtual address 00000100 

> > pgd = c0004000
> > [00000100] *pgd=00000000
> > Internal error: Oops: 5 [#1] ARM
> > Modules linked in:
> > CPU: 0    Not tainted  (3.5.0 #9)
> > PC is at s3c_hsotg_handle_outdone+0x44/0x158
> > LR is at s3c_hsotg_irq+0x75c/0x804
> > pc : [<c023e7fc>]    lr : [<c024061c>]    psr: 60000193
> > sp : c782fd20  ip : 00000029  fp : c13a1460
> > r10: 00000000  r9 : 00000008  r8 : 000000d0
> > r7 : c13a1400  r6 : 00000002  r5 : 00000000  r4 : 00060002
> > r3 : 000000d0  r2 : 00000000  r1 : 00080200  r0 : c13a1400
> > Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> > Control: 00c5387d  Table: 50004008  DAC: 00000017
> > Process swapper (pid: 1, stack limit = 0xc782e268)
> > Stack: (0xc782fd20 to 0xc7830000)
> > fd20: c13a1460 c0200f64 00000000 00060002 00000000 00000002
> > c13a1400 00000010 fd40: 00000000 c024061c 00060002 00000000
> > 00000002 00000008 c782fda0 c139a5c0 fd60: c139a5c0 00000000
> > 00000000 0000005a c04cc52c c04cc594 c04ea5fe c00565c0 fd80:
> > 00000000 00000000 00000000 c04cc52c c139a5c0 c04cc57c 00000000
> > c04eb328 fda0: c04cc55c c04eb324 c04c44c0 c0056768 c04cc52c
> > c04cc57c 00000000 c0058d64 fdc0: 0000005a c04d7dd8 00000000
> > c005617c 0000005a c000efbc c04eb350 00000001 fde0: c782fe08
> > c000853c c036c540 60000013 ffffffff c782fe3c c04cc57c c04cc55c
> > fe00: 60000013 c000dd80 c04cc57c c782c000 ffffffff 00000001
> > 60000013 c04cc52c fe20: c139a5c0 0000005a c04cc57c c04cc55c
> > 60000013 c04c44c0 f6010000 c782fe50 fe40: c036c53c c036c540
> > 60000013 ffffffff c023fec0 c00574c8 00000000 c008b2dc fe60:
> > c023fec0 00000000 00000000 c13a1400 0000005a c139a5c0 c04cc52c
> > c0057960 fe80: 0000005a c13a1400 c04c44b8 00000000 c051d238
> > c049b0ec 00000000 c03688fc fea0: c7853e60 c13a1400 c7804f80
> > 00000000 c04c44f4 60000013 c7855a80 00000000 fec0: c04e1bb4
> > c04c44c0 c04c44c0 c04e1bb4 c04e1bb4 c051d238 c049b0ec 00000000
> > fee0: c04eb040 c020588c c04c44c0 c0204524 c04c44c0 c04c44f4
> > c04e1bb4 c02046ac ff00: c13a01e0 c0204738 00000000 c782ff18
> > c04e1bb4 c0202e30 c7803878 c7823700 ff20: c04dd1d0 c040b8d4
> > c04e1bb4 c04e1bb4 c04dd1d0 c0203600 c040b8d4 c01b8568 ff40:
> > 00000000 00000000 c04e1bb4 00000007 c04eb040 c782e000 c04a65e0
> > c0204ce8 ff60: 00000000 c04a65d4 00000007 c04eb040 c782e000
> > c0008628 c04c7ea0 00000000 ff80: 0000009c 00000000 c0625cf9
> > c0037178 00000006 00000006 c0461b84 c042cee8 ffa0: c04c7ea0
> > c04abdd4 c04a65d4 00000007 c04eb040 0000009c c04841b0 c04a65e0
> > ffc0: 00000000 c048430c 00000006 00000006 c04841b0 00000000
> > 00000000 c048421c ffe0: c000f08c 00000013 00000000 00000000
> > 00000000 c000f08c 00000000 00000000 [<c023e7fc>]
> > (s3c_hsotg_handle_outdone+0x44/0x158) from [<c024061c>]
> > (s3c_hsotg_irq+0x75c/0x804) [<c024061c>]
> > (s3c_hsotg_irq+0x75c/0x804) from [<c00565c0>]
> > (handle_irq_event_percpu+0x50/0x1bc) [<c00565c0>]
> > (handle_irq_event_percpu+0x50/0x1bc) from [<c0056768>]
> > (handle_irq_event+0x3c/0x5c) [<c0056768>]
> > (handle_irq_event+0x3c/0x5c) from [<c0058d64>]
> > (handle_level_irq+0x8c/0x118) [<c0058d64>]
> > (handle_level_irq+0x8c/0x118) from [<c005617c>]
> > (generic_handle_irq+0x38/0x44) [<c005617c>]
> > (generic_handle_irq+0x38/0x44) from [<c000efbc>]
> > (handle_IRQ+0x30/0x84) [<c000efbc>] (handle_IRQ+0x30/0x84) from
> > [<c000853c>] (vic_handle_irq+0x68/0xa8) [<c000853c>]
> > (vic_handle_irq+0x68/0xa8) from [<c000dd80>] (__irq_svc+0x40/0x60)
> > Exception stack(0xc782fe08 to 0xc782fe50) fe00:
> > c04cc57c c782c000 ffffffff 00000001 60000013 c04cc52c fe20:
> > c139a5c0 0000005a c04cc57c c04cc55c 60000013 c04c44c0 f6010000
> > c782fe50 fe40: c036c53c c036c540 60000013 ffffffff [<c000dd80>]
> > (__irq_svc+0x40/0x60) from [<c036c540>]
> > (_raw_spin_unlock_irqrestore+0x10/0x14) [<c036c540>]
> > (_raw_spin_unlock_irqrestore+0x10/0x14) from [<c00574c8>]
> > (__setup_irq+0x178/0x3f8) [<c00574c8>] (__setup_irq+0x178/0x3f8)
> > from [<c0057960>] (request_threaded_irq+0xc4/0x12c) [<c0057960>]
> > (request_threaded_irq+0xc4/0x12c) from [<c03688fc>]
> > (s3c_hsotg_probe+0x14c/0x700) [<c03688fc>]
> > (s3c_hsotg_probe+0x14c/0x700) from [<c020588c>]
> > (platform_drv_probe+0x18/0x1c) [<c020588c>]
> > (platform_drv_probe+0x18/0x1c) from [<c0204524>]
> > (driver_probe_device+0x78/0x200) [<c0204524>]
> > (driver_probe_device+0x78/0x200) from [<c0204738>]
> > (__driver_attach+0x8c/0x90) [<c0204738>]
> > (__driver_attach+0x8c/0x90) from [<c0202e30>]
> > (bus_for_each_dev+0x60/0x8c) [<c0202e30>]
> > (bus_for_each_dev+0x60/0x8c) from [<c0203600>]
> > (bus_add_driver+0xac/0x250) [<c0203600>]
> > (bus_add_driver+0xac/0x250) from [<c0204ce8>]
> > (driver_register+0x58/0x130) [<c0204ce8>]
> > (driver_register+0x58/0x130) from [<c0008628>]
> > (do_one_initcall+0x34/0x17c) [<c0008628>]
> > (do_one_initcall+0x34/0x17c) from [<c048430c>]
> > (kernel_init+0xf0/0x1bc) [<c048430c>] (kernel_init+0xf0/0x1bc) from
> > [<c000f08c>] (kernel_thread_exit+0x0/0x8) Code: e0433106 e0833006
> > e1a03183 e0828003 (e5984030) ---[ end trace 2ea4e574318ecf99 ]---
> > Kernel panic - not syncing: Fatal exception in interrupt
> > -----------------------------------------------------------------------------------
> > 
> > 
> > When I try locate the source using arm-linux-gdb, I got this:
> > -------------------------------------------------------------
> > GNU gdb (Sourcery G++ Lite 2008q3-72) 6.8.50.20080821-cvs
> > Copyright (C) 2008 Free Software Foundation, Inc.
> > License GPLv3+: GNU GPL version 3 or later
> > <http://gnu.org/licenses/gpl.html> This is free software: you are
> > free to change and redistribute it. There is NO WARRANTY, to the
> > extent permitted by law.  Type "show copying" and "show warranty"
> > for details. This GDB was configured as "--host=i686-pc-linux-gnu
> > --target=arm-none-linux-gnueabi".
> > For bug reporting instructions, please see:
> > <https://support.codesourcery.com/GNUToolchain/>...
> > (gdb) l *(s3c_hsotg_handle_outdone+0x44)
> > 0xc023e7fc is in s3c_hsotg_handle_outdone
> > (drivers/usb/gadget/s3c-hsotg.c:1553). 1548	static void
> > s3c_hsotg_handle_outdone(struct s3c_hsotg *hsotg,
> > 1549					     int epnum, bool
> > was_setup) 1550	{ 1551		u32 epsize =
> > readl(hsotg->regs + DOEPTSIZ(epnum)); 1552		struct
> > s3c_hsotg_ep *hs_ep = &hsotg->eps[epnum]; 1553
> > struct s3c_hsotg_req *hs_req = hs_ep->req; 1554
> > struct usb_request *req = &hs_req->req; 1555
> > unsigned size_left = DxEPTSIZ_XferSize_GET(epsize);
> > 1556		int result = 0; 1557	
> > (gdb)
> > 
> > 
> > 
> > I also try the old linux like 2.6.36, I works fine.
> 
> Lukasz, any ideas ?
> 

I see, that you are using 3.5.0 kernel.
During the 3.5 kernel development cycle, I've discovered very nasty SMP
related bug. It is fixed at 3.6-rc1 code.

Relevant commits are:
22258f4 usb: hsotg: samsung: Replace endpoint specific locks with a
global lock
2b19a52 usb: hsotg: samsung: Protect the udc_stop routine with spinlock
5ad1d31 usb: hsotg: samsung: smp Provide *_lock functions abstraction
layer for SMP SoCs

Above commits are already available at 3.6-rc1.

Would it be possible to cross compile 3.6-rc1 kernel for your platform
and test the USB?



I'd like to ask you for #define DEBUG above includes (to enable
dev_dbg()) calls at ./drivers/usb/gadget/s3c-hsotg.c file.

Afterwards please, paste the log (dmesg) from booting your target
device.

Thanks in advance.

-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5
  2012-08-06 13:14   ` Lukasz Majewski
@ 2012-08-07  3:04     ` Peiyong Feng
  2012-08-07  9:34       ` Lukasz Majewski
  2012-08-07 16:34     ` Mark Brown
  1 sibling, 1 reply; 9+ messages in thread
From: Peiyong Feng @ 2012-08-07  3:04 UTC (permalink / raw)
  To: Lukasz Majewski; +Cc: balbi, linux-usb, linux-kernel

2012/8/6 Lukasz Majewski <l.majewski@samsung.com>:
> Hi,
>
>> Hi,
>>
>> On Mon, Aug 06, 2012 at 06:12:05PM +0800, Peiyong Feng wrote:
>> > I got a kernel panic when try hsotg of ok6410 which is based on
>> > s3c6410:
> As you said, you are using the ok6410. And it is "based" on the s3c6410
> CPU. S3C6410 is a single core CPU. I assume that ok6410 is also single
> core?
yes
>
>> >
>> >
>> > cdc_acm: USB Abstract Control Model driver for USB modems and ISDN
>> > adapters Unable to handle kernel NULL pointer dereference at
>> > virtual address 00000100
>
>> > pgd = c0004000
>> > [00000100] *pgd=00000000
>> > Internal error: Oops: 5 [#1] ARM
>> > Modules linked in:
>> > CPU: 0    Not tainted  (3.5.0 #9)
>> > PC is at s3c_hsotg_handle_outdone+0x44/0x158
>> > LR is at s3c_hsotg_irq+0x75c/0x804
>> > pc : [<c023e7fc>]    lr : [<c024061c>]    psr: 60000193
>> > sp : c782fd20  ip : 00000029  fp : c13a1460
>> > r10: 00000000  r9 : 00000008  r8 : 000000d0
>> > r7 : c13a1400  r6 : 00000002  r5 : 00000000  r4 : 00060002
>> > r3 : 000000d0  r2 : 00000000  r1 : 00080200  r0 : c13a1400
>> > Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
>> > Control: 00c5387d  Table: 50004008  DAC: 00000017
>> > Process swapper (pid: 1, stack limit = 0xc782e268)
>> > Stack: (0xc782fd20 to 0xc7830000)
>> > fd20: c13a1460 c0200f64 00000000 00060002 00000000 00000002
>> > c13a1400 00000010 fd40: 00000000 c024061c 00060002 00000000
>> > 00000002 00000008 c782fda0 c139a5c0 fd60: c139a5c0 00000000
>> > 00000000 0000005a c04cc52c c04cc594 c04ea5fe c00565c0 fd80:
>> > 00000000 00000000 00000000 c04cc52c c139a5c0 c04cc57c 00000000
>> > c04eb328 fda0: c04cc55c c04eb324 c04c44c0 c0056768 c04cc52c
>> > c04cc57c 00000000 c0058d64 fdc0: 0000005a c04d7dd8 00000000
>> > c005617c 0000005a c000efbc c04eb350 00000001 fde0: c782fe08
>> > c000853c c036c540 60000013 ffffffff c782fe3c c04cc57c c04cc55c
>> > fe00: 60000013 c000dd80 c04cc57c c782c000 ffffffff 00000001
>> > 60000013 c04cc52c fe20: c139a5c0 0000005a c04cc57c c04cc55c
>> > 60000013 c04c44c0 f6010000 c782fe50 fe40: c036c53c c036c540
>> > 60000013 ffffffff c023fec0 c00574c8 00000000 c008b2dc fe60:
>> > c023fec0 00000000 00000000 c13a1400 0000005a c139a5c0 c04cc52c
>> > c0057960 fe80: 0000005a c13a1400 c04c44b8 00000000 c051d238
>> > c049b0ec 00000000 c03688fc fea0: c7853e60 c13a1400 c7804f80
>> > 00000000 c04c44f4 60000013 c7855a80 00000000 fec0: c04e1bb4
>> > c04c44c0 c04c44c0 c04e1bb4 c04e1bb4 c051d238 c049b0ec 00000000
>> > fee0: c04eb040 c020588c c04c44c0 c0204524 c04c44c0 c04c44f4
>> > c04e1bb4 c02046ac ff00: c13a01e0 c0204738 00000000 c782ff18
>> > c04e1bb4 c0202e30 c7803878 c7823700 ff20: c04dd1d0 c040b8d4
>> > c04e1bb4 c04e1bb4 c04dd1d0 c0203600 c040b8d4 c01b8568 ff40:
>> > 00000000 00000000 c04e1bb4 00000007 c04eb040 c782e000 c04a65e0
>> > c0204ce8 ff60: 00000000 c04a65d4 00000007 c04eb040 c782e000
>> > c0008628 c04c7ea0 00000000 ff80: 0000009c 00000000 c0625cf9
>> > c0037178 00000006 00000006 c0461b84 c042cee8 ffa0: c04c7ea0
>> > c04abdd4 c04a65d4 00000007 c04eb040 0000009c c04841b0 c04a65e0
>> > ffc0: 00000000 c048430c 00000006 00000006 c04841b0 00000000
>> > 00000000 c048421c ffe0: c000f08c 00000013 00000000 00000000
>> > 00000000 c000f08c 00000000 00000000 [<c023e7fc>]
>> > (s3c_hsotg_handle_outdone+0x44/0x158) from [<c024061c>]
>> > (s3c_hsotg_irq+0x75c/0x804) [<c024061c>]
>> > (s3c_hsotg_irq+0x75c/0x804) from [<c00565c0>]
>> > (handle_irq_event_percpu+0x50/0x1bc) [<c00565c0>]
>> > (handle_irq_event_percpu+0x50/0x1bc) from [<c0056768>]
>> > (handle_irq_event+0x3c/0x5c) [<c0056768>]
>> > (handle_irq_event+0x3c/0x5c) from [<c0058d64>]
>> > (handle_level_irq+0x8c/0x118) [<c0058d64>]
>> > (handle_level_irq+0x8c/0x118) from [<c005617c>]
>> > (generic_handle_irq+0x38/0x44) [<c005617c>]
>> > (generic_handle_irq+0x38/0x44) from [<c000efbc>]
>> > (handle_IRQ+0x30/0x84) [<c000efbc>] (handle_IRQ+0x30/0x84) from
>> > [<c000853c>] (vic_handle_irq+0x68/0xa8) [<c000853c>]
>> > (vic_handle_irq+0x68/0xa8) from [<c000dd80>] (__irq_svc+0x40/0x60)
>> > Exception stack(0xc782fe08 to 0xc782fe50) fe00:
>> > c04cc57c c782c000 ffffffff 00000001 60000013 c04cc52c fe20:
>> > c139a5c0 0000005a c04cc57c c04cc55c 60000013 c04c44c0 f6010000
>> > c782fe50 fe40: c036c53c c036c540 60000013 ffffffff [<c000dd80>]
>> > (__irq_svc+0x40/0x60) from [<c036c540>]
>> > (_raw_spin_unlock_irqrestore+0x10/0x14) [<c036c540>]
>> > (_raw_spin_unlock_irqrestore+0x10/0x14) from [<c00574c8>]
>> > (__setup_irq+0x178/0x3f8) [<c00574c8>] (__setup_irq+0x178/0x3f8)
>> > from [<c0057960>] (request_threaded_irq+0xc4/0x12c) [<c0057960>]
>> > (request_threaded_irq+0xc4/0x12c) from [<c03688fc>]
>> > (s3c_hsotg_probe+0x14c/0x700) [<c03688fc>]
>> > (s3c_hsotg_probe+0x14c/0x700) from [<c020588c>]
>> > (platform_drv_probe+0x18/0x1c) [<c020588c>]
>> > (platform_drv_probe+0x18/0x1c) from [<c0204524>]
>> > (driver_probe_device+0x78/0x200) [<c0204524>]
>> > (driver_probe_device+0x78/0x200) from [<c0204738>]
>> > (__driver_attach+0x8c/0x90) [<c0204738>]
>> > (__driver_attach+0x8c/0x90) from [<c0202e30>]
>> > (bus_for_each_dev+0x60/0x8c) [<c0202e30>]
>> > (bus_for_each_dev+0x60/0x8c) from [<c0203600>]
>> > (bus_add_driver+0xac/0x250) [<c0203600>]
>> > (bus_add_driver+0xac/0x250) from [<c0204ce8>]
>> > (driver_register+0x58/0x130) [<c0204ce8>]
>> > (driver_register+0x58/0x130) from [<c0008628>]
>> > (do_one_initcall+0x34/0x17c) [<c0008628>]
>> > (do_one_initcall+0x34/0x17c) from [<c048430c>]
>> > (kernel_init+0xf0/0x1bc) [<c048430c>] (kernel_init+0xf0/0x1bc) from
>> > [<c000f08c>] (kernel_thread_exit+0x0/0x8) Code: e0433106 e0833006
>> > e1a03183 e0828003 (e5984030) ---[ end trace 2ea4e574318ecf99 ]---
>> > Kernel panic - not syncing: Fatal exception in interrupt
>> > -----------------------------------------------------------------------------------
>> >
>> >
>> > When I try locate the source using arm-linux-gdb, I got this:
>> > -------------------------------------------------------------
>> > GNU gdb (Sourcery G++ Lite 2008q3-72) 6.8.50.20080821-cvs
>> > Copyright (C) 2008 Free Software Foundation, Inc.
>> > License GPLv3+: GNU GPL version 3 or later
>> > <http://gnu.org/licenses/gpl.html> This is free software: you are
>> > free to change and redistribute it. There is NO WARRANTY, to the
>> > extent permitted by law.  Type "show copying" and "show warranty"
>> > for details. This GDB was configured as "--host=i686-pc-linux-gnu
>> > --target=arm-none-linux-gnueabi".
>> > For bug reporting instructions, please see:
>> > <https://support.codesourcery.com/GNUToolchain/>...
>> > (gdb) l *(s3c_hsotg_handle_outdone+0x44)
>> > 0xc023e7fc is in s3c_hsotg_handle_outdone
>> > (drivers/usb/gadget/s3c-hsotg.c:1553). 1548 static void
>> > s3c_hsotg_handle_outdone(struct s3c_hsotg *hsotg,
>> > 1549                                             int epnum, bool
>> > was_setup) 1550     { 1551          u32 epsize =
>> > readl(hsotg->regs + DOEPTSIZ(epnum)); 1552          struct
>> > s3c_hsotg_ep *hs_ep = &hsotg->eps[epnum]; 1553
>> > struct s3c_hsotg_req *hs_req = hs_ep->req; 1554
>> > struct usb_request *req = &hs_req->req; 1555
>> > unsigned size_left = DxEPTSIZ_XferSize_GET(epsize);
>> > 1556                int result = 0; 1557
>> > (gdb)
>> >
>> >
>> >
>> > I also try the old linux like 2.6.36, I works fine.
>>
>> Lukasz, any ideas ?
>>
>
> I see, that you are using 3.5.0 kernel.
> During the 3.5 kernel development cycle, I've discovered very nasty SMP
> related bug. It is fixed at 3.6-rc1 code.
>
> Relevant commits are:
> 22258f4 usb: hsotg: samsung: Replace endpoint specific locks with a
> global lock
> 2b19a52 usb: hsotg: samsung: Protect the udc_stop routine with spinlock
> 5ad1d31 usb: hsotg: samsung: smp Provide *_lock functions abstraction
> layer for SMP SoCs
>
> Above commits are already available at 3.6-rc1.
>
> Would it be possible to cross compile 3.6-rc1 kernel for your platform
> and test the USB?
>
>
>
> I'd like to ask you for #define DEBUG above includes (to enable
> dev_dbg()) calls at ./drivers/usb/gadget/s3c-hsotg.c file.
>
> Afterwards please, paste the log (dmesg) from booting your target
> device.
Still canot work, log:
Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.6.0-rc1-00133-g42a579a-dirty (root@xxxx) (gcc version
4.3.2 (Sourcery G++ Lite 2008q3-72) ) 2
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: SMDK6410
Memory policy: ECC disabled, Data cache writeback
CPU S3C6410 (id 0x36410101)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
camera: no parent clock specified
S3C64XX: PLL settings, A=532000000, M=532000000, E=24000000
S3C64XX: HCLK2=266000000, HCLK=133000000, PCLK=66500000
mout_apll: source is fout_apll (1), rate is 532000000
mout_epll: source is epll (1), rate is 24000000
mout_mpll: source is mpll (1), rate is 532000000
usb-bus-host: source is clk_48m (0), rate is 48000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
irda-bus: source is mout_epll (0), rate is 24000000
camera: no parent clock specified
CPU: found DTCM0 8k @ 00000000, not enabled
CPU: moved DTCM0 8k to fffe8000, enabled
CPU: found DTCM1 8k @ 00000000, not enabled
CPU: moved DTCM1 8k to fffea000, enabled
CPU: found ITCM0 8k @ 00000000, not enabled
CPU: moved ITCM0 8k to fffe0000, enabled
CPU: found ITCM1 8k @ 00000000, not enabled
CPU: moved ITCM1 8k to fffe2000, enabled
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: console=ttySAC0,115200 root=/dev/ram
init=/linuxrc initrd=0x51000000,6M ramdisk_size=6144
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 120316k/120316k available, 10756k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    DTCM    : 0xfffe8000 - 0xfffec000   (  16 kB)
    ITCM    : 0xfffe0000 - 0xfffe4000   (  16 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc02d7a64   (2879 kB)
      .init : 0xc02d8000 - 0xc02f662c   ( 122 kB)
      .data : 0xc02f8000 - 0xc0326420   ( 186 kB)
       .bss : 0xc0327024 - 0xc0358858   ( 199 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:246
VIC @f6000000: id 0x00041192, vendor 0x41
VIC @f6010000: id 0x00041192, vendor 0x41
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
Calibrating delay loop... 353.89 BogoMIPS (lpj=1769472)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x5021c868 - 0x5021c8c4
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
s3c64xx_dma_init: Registering DMA channels
PL080: IRQ 73, at c8846000, channels 0..8
PL080: IRQ 74, at c8848000, channels 8..16
S3C6410: Initialising architecture
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c-i2c s3c2440-i2c.0: slave address 0x10
s3c-i2c s3c2440-i2c.0: bus frequency set to 64 KHz
s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter
s3c-i2c s3c2440-i2c.1: slave address 0x10
s3c-i2c s3c2440-i2c.1: bus frequency set to 64 KHz
s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (junk in compressed archive); looks like an initrd
Freeing initrd memory: 6144K
ROMFS MTD (C) 2007 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
start plist test
end plist test
s3c-fb s3c-fb: window 0: fb
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
s3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 69) is a S3C6400/10
console [ttySAC0] enabled
s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10
s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10
s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10
brd: module loaded
loop: module loaded
at24 0-0050: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
at24 1-0057: 16384 byte 24c128 EEPROM, writable, 1 bytes/write
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: S3C24XX OHCI
usb usb1: Manufacturer: Linux 3.6.0-rc1-00133-g42a579a-dirty ohci_hcd
usb usb1: SerialNumber: s3c24xx
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Unable to handle kernel NULL pointer dereference at virtual address 000000e0
pgd = c0004000
[000000e0] *pgd=00000000
Internal error: Oops: 5 [#1] ARM
Modules linked in:
CPU: 0    Not tainted  (3.6.0-rc1-00133-g42a579a-dirty #19)
PC is at s3c_hsotg_handle_outdone+0x40/0xdc
LR is at s3c_hsotg_irq+0x5a0/0x5fc
pc : [<c01a3408>]    lr : [<c01a4eb8>]    psr: 80000193
sp : c782fd18  ip : 00000000  fp : c139301c
r10: 00000000  r9 : 00000008  r8 : 00000000
r7 : c1393010  r6 : 000000b0  r5 : 00000002  r4 : c1392300
r3 : 000000b0  r2 : 00000000  r1 : 00080200  r0 : c1393010
Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 00c5387d  Table: 50004008  DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc782e268)
Stack: (0xc782fd18 to 0xc7830000)
fd00:                                                       c1392300 c1392300
fd20: 00000000 c1393010 00000010 c01a4eb8 c782fd84 c1393078 000012d0 c1392300
fd40: c1392300 00000000 00000000 0000005a c0310aec c0310b54 c03263c1 c0056e44
fd60: c0325c8c 00000000 22222222 c0310aec c1392300 c0310b3c 00000000 c0327328
fd80: c0310b1c c0327324 c0327040 c0056fe4 c0310aec c0310b3c 00000000 c00595e8
fda0: 0000005a c0318d68 00000000 c0056a00 0000005a c000efdc c0327350 00000001
fdc0: c782fde8 c0008508 c021c7c0 60000013 ffffffff c782fe1c c0310b3c c0310b1c
fde0: 60000013 c000dd80 c0310b3c c782c000 ffffffff 00000001 60000013 c0310aec
fe00: c1392300 0000005a c0310b3c c0310b1c 60000013 c0327040 f6010000 c782fe30
fe20: c021c7bc c021c7c0 60000013 ffffffff c01a4918 c0057d48 c138bc90 c008c344
fe40: c01a4918 00000000 00000000 c1393010 0000005a c1392300 c0310aec c00581e4
fe60: c138bcd0 00000000 c01a4918 0000005a c1393010 c02ede10 c0308998 c0059e00
fe80: c784fe60 c1393010 c784fe60 0000005a c1393010 c0308990 c03229e8 c0308998
fea0: c02f1818 c0218c7c 00000000 c784fe60 c1393010 00000000 c03089cc 60000013
fec0: c7851940 00000000 c03229e8 c0308998 c0308998 c03229e8 c03229e8 c0357938
fee0: c02ede10 c02f1818 c0327040 c016ba7c c0308998 c016a6f0 c0308998 c03089cc
ff00: c03229e8 c016a880 c782e000 c016a90c 00000000 c782ff20 c03229e8 c0168fe8
ff20: c7803878 c7823ac0 c031e0c8 c02875cc c138c480 c03229e8 c031e0c8 c01697b8
ff40: c02875cc c03229e8 00000007 00000000 c03229e8 00000007 c0327040 c016aebc
ff60: 00000000 c02f180c 00000007 c0327040 c782e000 c00085f0 c030c378 00000000
ff80: 00000053 00000000 c0459cf9 c00377dc 00000006 00000006 c02c1380 c02a0130
ffa0: c030c378 c02f6380 c02f180c 00000007 c0327040 00000053 c02d81b0 c02f1818
ffc0: 00000000 c02d830c 00000006 00000006 c02d81b0 00000000 00000000 c02d821c
ffe0: c000f0ac 00000013 00000000 00000000 00000000 c000f0ac 0002fbf7 00007fff
[<c01a3408>] (s3c_hsotg_handle_outdone+0x40/0xdc) from [<c01a4eb8>]
(s3c_hsotg_irq+0x5a0/0x5fc)
[<c01a4eb8>] (s3c_hsotg_irq+0x5a0/0x5fc) from [<c0056e44>]
(handle_irq_event_percpu+0x50/0x1b4)
[<c0056e44>] (handle_irq_event_percpu+0x50/0x1b4) from [<c0056fe4>]
(handle_irq_event+0x3c/0x5c)
[<c0056fe4>] (handle_irq_event+0x3c/0x5c) from [<c00595e8>]
(handle_level_irq+0x8c/0x118)
[<c00595e8>] (handle_level_irq+0x8c/0x118) from [<c0056a00>]
(generic_handle_irq+0x38/0x44)
[<c0056a00>] (generic_handle_irq+0x38/0x44) from [<c000efdc>]
(handle_IRQ+0x30/0x84)
[<c000efdc>] (handle_IRQ+0x30/0x84) from [<c0008508>] (vic_handle_irq+0x68/0xa8)
[<c0008508>] (vic_handle_irq+0x68/0xa8) from [<c000dd80>] (__irq_svc+0x40/0x54)
Exception stack(0xc782fde8 to 0xc782fe30)
fde0:                   c0310b3c c782c000 ffffffff 00000001 60000013 c0310aec
fe00: c1392300 0000005a c0310b3c c0310b1c 60000013 c0327040 f6010000 c782fe30
fe20: c021c7bc c021c7c0 60000013 ffffffff
[<c000dd80>] (__irq_svc+0x40/0x54) from [<c021c7c0>]
(_raw_spin_unlock_irqrestore+0x10/0x14)
[<c021c7c0>] (_raw_spin_unlock_irqrestore+0x10/0x14) from [<c0057d48>]
(__setup_irq+0x184/0x408)
[<c0057d48>] (__setup_irq+0x184/0x408) from [<c00581e4>]
(request_threaded_irq+0xc4/0x12c)
[<c00581e4>] (request_threaded_irq+0xc4/0x12c) from [<c0059e00>]
(devm_request_threaded_irq+0x58/0x8c)
[<c0059e00>] (devm_request_threaded_irq+0x58/0x8c) from [<c0218c7c>]
(s3c_hsotg_probe+0xdc/0x5c0)
[<c0218c7c>] (s3c_hsotg_probe+0xdc/0x5c0) from [<c016ba7c>]
(platform_drv_probe+0x18/0x1c)
[<c016ba7c>] (platform_drv_probe+0x18/0x1c) from [<c016a6f0>]
(driver_probe_device+0x78/0x208)
[<c016a6f0>] (driver_probe_device+0x78/0x208) from [<c016a90c>]
(__driver_attach+0x8c/0x90)
[<c016a90c>] (__driver_attach+0x8c/0x90) from [<c0168fe8>]
(bus_for_each_dev+0x60/0x8c)
[<c0168fe8>] (bus_for_each_dev+0x60/0x8c) from [<c01697b8>]
(bus_add_driver+0xac/0x248)
[<c01697b8>] (bus_add_driver+0xac/0x248) from [<c016aebc>]
(driver_register+0x58/0x14c)
[<c016aebc>] (driver_register+0x58/0x14c) from [<c00085f0>]
(do_one_initcall+0x34/0x17c)
[<c00085f0>] (do_one_initcall+0x34/0x17c) from [<c02d830c>]
(kernel_init+0xf0/0x1bc)
[<c02d830c>] (kernel_init+0xf0/0x1bc) from [<c000f0ac>]
(kernel_thread_exit+0x0/0x8)
Code: e0433105 e0653003 e1a03183 e0826003 (e5964030)
---[ end trace 91f15b573a676870 ]---
Kernel panic - not syncing: Fatal exception in interrupt

>
> Thanks in advance.
>
> --
> Best regards,
>
> Lukasz Majewski
>
> Samsung Poland R&D Center | Linux Platform Group

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5
  2012-08-07  3:04     ` Peiyong Feng
@ 2012-08-07  9:34       ` Lukasz Majewski
  2012-08-08  5:02         ` Peiyong Feng
  0 siblings, 1 reply; 9+ messages in thread
From: Lukasz Majewski @ 2012-08-07  9:34 UTC (permalink / raw)
  To: Peiyong Feng; +Cc: balbi, linux-usb, linux-kernel

On Tue, 07 Aug 2012 11:04:10 +0800
Peiyong Feng <peiyong.feng.kernel@gmail.com> wrote:

> 2012/8/6 Lukasz Majewski <l.majewski@samsung.com>:
> > Hi,
> >
> >> Hi,
> >>
> >> On Mon, Aug 06, 2012 at 06:12:05PM +0800, Peiyong Feng wrote:
> >> > I got a kernel panic when try hsotg of ok6410 which is based on
> >> > s3c6410:
> > As you said, you are using the ok6410. And it is "based" on the
> > s3c6410 CPU. S3C6410 is a single core CPU. I assume that ok6410 is
> > also single core?
> yes
> >
> >> >
> >> >
> >> > cdc_acm: USB Abstract Control Model driver for USB modems and
> >> > ISDN adapters Unable to handle kernel NULL pointer dereference at
> >> > virtual address 00000100
> >
> >> > pgd = c0004000
> >> > [00000100] *pgd=00000000
> >> > Internal error: Oops: 5 [#1] ARM
> >> > Modules linked in:
> >> > CPU: 0    Not tainted  (3.5.0 #9)
> >> > PC is at s3c_hsotg_handle_outdone+0x44/0x158
> >> > LR is at s3c_hsotg_irq+0x75c/0x804
> >> > pc : [<c023e7fc>]    lr : [<c024061c>]    psr: 60000193
> >> > sp : c782fd20  ip : 00000029  fp : c13a1460
> >> > r10: 00000000  r9 : 00000008  r8 : 000000d0
> >> > r7 : c13a1400  r6 : 00000002  r5 : 00000000  r4 : 00060002
> >> > r3 : 000000d0  r2 : 00000000  r1 : 00080200  r0 : c13a1400
> >> > Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment
> >> > kernel Control: 00c5387d  Table: 50004008  DAC: 00000017
> >> > Process swapper (pid: 1, stack limit = 0xc782e268)
> >> > Stack: (0xc782fd20 to 0xc7830000)
> >> > fd20: c13a1460 c0200f64 00000000 00060002 00000000 00000002
> >> > c13a1400 00000010 fd40: 00000000 c024061c 00060002 00000000
> >> > 00000002 00000008 c782fda0 c139a5c0 fd60: c139a5c0 00000000
> >> > 00000000 0000005a c04cc52c c04cc594 c04ea5fe c00565c0 fd80:
> >> > 00000000 00000000 00000000 c04cc52c c139a5c0 c04cc57c 00000000
> >> > c04eb328 fda0: c04cc55c c04eb324 c04c44c0 c0056768 c04cc52c
> >> > c04cc57c 00000000 c0058d64 fdc0: 0000005a c04d7dd8 00000000
> >> > c005617c 0000005a c000efbc c04eb350 00000001 fde0: c782fe08
> >> > c000853c c036c540 60000013 ffffffff c782fe3c c04cc57c c04cc55c
> >> > fe00: 60000013 c000dd80 c04cc57c c782c000 ffffffff 00000001
> >> > 60000013 c04cc52c fe20: c139a5c0 0000005a c04cc57c c04cc55c
> >> > 60000013 c04c44c0 f6010000 c782fe50 fe40: c036c53c c036c540
> >> > 60000013 ffffffff c023fec0 c00574c8 00000000 c008b2dc fe60:
> >> > c023fec0 00000000 00000000 c13a1400 0000005a c139a5c0 c04cc52c
> >> > c0057960 fe80: 0000005a c13a1400 c04c44b8 00000000 c051d238
> >> > c049b0ec 00000000 c03688fc fea0: c7853e60 c13a1400 c7804f80
> >> > 00000000 c04c44f4 60000013 c7855a80 00000000 fec0: c04e1bb4
> >> > c04c44c0 c04c44c0 c04e1bb4 c04e1bb4 c051d238 c049b0ec 00000000
> >> > fee0: c04eb040 c020588c c04c44c0 c0204524 c04c44c0 c04c44f4
> >> > c04e1bb4 c02046ac ff00: c13a01e0 c0204738 00000000 c782ff18
> >> > c04e1bb4 c0202e30 c7803878 c7823700 ff20: c04dd1d0 c040b8d4
> >> > c04e1bb4 c04e1bb4 c04dd1d0 c0203600 c040b8d4 c01b8568 ff40:
> >> > 00000000 00000000 c04e1bb4 00000007 c04eb040 c782e000 c04a65e0
> >> > c0204ce8 ff60: 00000000 c04a65d4 00000007 c04eb040 c782e000
> >> > c0008628 c04c7ea0 00000000 ff80: 0000009c 00000000 c0625cf9
> >> > c0037178 00000006 00000006 c0461b84 c042cee8 ffa0: c04c7ea0
> >> > c04abdd4 c04a65d4 00000007 c04eb040 0000009c c04841b0 c04a65e0
> >> > ffc0: 00000000 c048430c 00000006 00000006 c04841b0 00000000
> >> > 00000000 c048421c ffe0: c000f08c 00000013 00000000 00000000
> >> > 00000000 c000f08c 00000000 00000000 [<c023e7fc>]
> >> > (s3c_hsotg_handle_outdone+0x44/0x158) from [<c024061c>]
> >> > (s3c_hsotg_irq+0x75c/0x804) [<c024061c>]
> >> > (s3c_hsotg_irq+0x75c/0x804) from [<c00565c0>]
> >> > (handle_irq_event_percpu+0x50/0x1bc) [<c00565c0>]
> >> > (handle_irq_event_percpu+0x50/0x1bc) from [<c0056768>]
> >> > (handle_irq_event+0x3c/0x5c) [<c0056768>]
> >> > (handle_irq_event+0x3c/0x5c) from [<c0058d64>]
> >> > (handle_level_irq+0x8c/0x118) [<c0058d64>]
> >> > (handle_level_irq+0x8c/0x118) from [<c005617c>]
> >> > (generic_handle_irq+0x38/0x44) [<c005617c>]
> >> > (generic_handle_irq+0x38/0x44) from [<c000efbc>]
> >> > (handle_IRQ+0x30/0x84) [<c000efbc>] (handle_IRQ+0x30/0x84) from
> >> > [<c000853c>] (vic_handle_irq+0x68/0xa8) [<c000853c>]
> >> > (vic_handle_irq+0x68/0xa8) from [<c000dd80>]
> >> > (__irq_svc+0x40/0x60) Exception stack(0xc782fe08 to 0xc782fe50)
> >> > fe00: c04cc57c c782c000 ffffffff 00000001 60000013 c04cc52c fe20:
> >> > c139a5c0 0000005a c04cc57c c04cc55c 60000013 c04c44c0 f6010000
> >> > c782fe50 fe40: c036c53c c036c540 60000013 ffffffff [<c000dd80>]
> >> > (__irq_svc+0x40/0x60) from [<c036c540>]
> >> > (_raw_spin_unlock_irqrestore+0x10/0x14) [<c036c540>]
> >> > (_raw_spin_unlock_irqrestore+0x10/0x14) from [<c00574c8>]
> >> > (__setup_irq+0x178/0x3f8) [<c00574c8>] (__setup_irq+0x178/0x3f8)
> >> > from [<c0057960>] (request_threaded_irq+0xc4/0x12c) [<c0057960>]
> >> > (request_threaded_irq+0xc4/0x12c) from [<c03688fc>]
> >> > (s3c_hsotg_probe+0x14c/0x700) [<c03688fc>]
> >> > (s3c_hsotg_probe+0x14c/0x700) from [<c020588c>]
> >> > (platform_drv_probe+0x18/0x1c) [<c020588c>]
> >> > (platform_drv_probe+0x18/0x1c) from [<c0204524>]
> >> > (driver_probe_device+0x78/0x200) [<c0204524>]
> >> > (driver_probe_device+0x78/0x200) from [<c0204738>]
> >> > (__driver_attach+0x8c/0x90) [<c0204738>]
> >> > (__driver_attach+0x8c/0x90) from [<c0202e30>]
> >> > (bus_for_each_dev+0x60/0x8c) [<c0202e30>]
> >> > (bus_for_each_dev+0x60/0x8c) from [<c0203600>]
> >> > (bus_add_driver+0xac/0x250) [<c0203600>]
> >> > (bus_add_driver+0xac/0x250) from [<c0204ce8>]
> >> > (driver_register+0x58/0x130) [<c0204ce8>]
> >> > (driver_register+0x58/0x130) from [<c0008628>]
> >> > (do_one_initcall+0x34/0x17c) [<c0008628>]
> >> > (do_one_initcall+0x34/0x17c) from [<c048430c>]
> >> > (kernel_init+0xf0/0x1bc) [<c048430c>] (kernel_init+0xf0/0x1bc)
> >> > from [<c000f08c>] (kernel_thread_exit+0x0/0x8) Code: e0433106
> >> > e0833006 e1a03183 e0828003 (e5984030) ---[ end trace
> >> > 2ea4e574318ecf99 ]--- Kernel panic - not syncing: Fatal
> >> > exception in interrupt
> >> > -----------------------------------------------------------------------------------
> >> >
> >> >
> >> > When I try locate the source using arm-linux-gdb, I got this:
> >> > -------------------------------------------------------------
> >> > GNU gdb (Sourcery G++ Lite 2008q3-72) 6.8.50.20080821-cvs
> >> > Copyright (C) 2008 Free Software Foundation, Inc.
> >> > License GPLv3+: GNU GPL version 3 or later
> >> > <http://gnu.org/licenses/gpl.html> This is free software: you are
> >> > free to change and redistribute it. There is NO WARRANTY, to the
> >> > extent permitted by law.  Type "show copying" and "show warranty"
> >> > for details. This GDB was configured as "--host=i686-pc-linux-gnu
> >> > --target=arm-none-linux-gnueabi".
> >> > For bug reporting instructions, please see:
> >> > <https://support.codesourcery.com/GNUToolchain/>...
> >> > (gdb) l *(s3c_hsotg_handle_outdone+0x44)
> >> > 0xc023e7fc is in s3c_hsotg_handle_outdone
> >> > (drivers/usb/gadget/s3c-hsotg.c:1553). 1548 static void
> >> > s3c_hsotg_handle_outdone(struct s3c_hsotg *hsotg,
> >> > 1549                                             int epnum, bool
> >> > was_setup) 1550     { 1551          u32 epsize =
> >> > readl(hsotg->regs + DOEPTSIZ(epnum)); 1552          struct
> >> > s3c_hsotg_ep *hs_ep = &hsotg->eps[epnum]; 1553
> >> > struct s3c_hsotg_req *hs_req = hs_ep->req; 1554
> >> > struct usb_request *req = &hs_req->req; 1555
> >> > unsigned size_left = DxEPTSIZ_XferSize_GET(epsize);
> >> > 1556                int result = 0; 1557
> >> > (gdb)
> >> >
> >> >
> >> >
> >> > I also try the old linux like 2.6.36, I works fine.
> >>
> >> Lukasz, any ideas ?
> >>
> >
> > I see, that you are using 3.5.0 kernel.
> > During the 3.5 kernel development cycle, I've discovered very nasty
> > SMP related bug. It is fixed at 3.6-rc1 code.
> >
> > Relevant commits are:
> > 22258f4 usb: hsotg: samsung: Replace endpoint specific locks with a
> > global lock
> > 2b19a52 usb: hsotg: samsung: Protect the udc_stop routine with
> > spinlock 5ad1d31 usb: hsotg: samsung: smp Provide *_lock functions
> > abstraction layer for SMP SoCs
> >
> > Above commits are already available at 3.6-rc1.
> >
> > Would it be possible to cross compile 3.6-rc1 kernel for your
> > platform and test the USB?
> >
> >
> >
> > I'd like to ask you for #define DEBUG above includes (to enable
> > dev_dbg()) calls at ./drivers/usb/gadget/s3c-hsotg.c file.

Please enable the debug at s3c-hsotg.c driver and then paste the
dmesg/debug output. 

> >
> > Afterwards please, paste the log (dmesg) from booting your target
> > device.
> Still canot work, log:
> Starting kernel ...
> 
> Uncompressing Linux... done, booting the kernel.
> Booting Linux on physical CPU 0
> Linux version 3.6.0-rc1-00133-g42a579a-dirty (root@xxxx) (gcc version
> 4.3.2 (Sourcery G++ Lite 2008q3-72) ) 2
> CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7),
> cr=00c5387d CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing
> instruction cache Machine: SMDK6410
> Memory policy: ECC disabled, Data cache writeback
> CPU S3C6410 (id 0x36410101)
> S3C24XX Clocks, Copyright 2004 Simtec Electronics
> camera: no parent clock specified
> S3C64XX: PLL settings, A=532000000, M=532000000, E=24000000
> S3C64XX: HCLK2=266000000, HCLK=133000000, PCLK=66500000
> mout_apll: source is fout_apll (1), rate is 532000000
> mout_epll: source is epll (1), rate is 24000000
> mout_mpll: source is mpll (1), rate is 532000000
> usb-bus-host: source is clk_48m (0), rate is 48000000
> audio-bus: source is mout_epll (0), rate is 24000000
> audio-bus: source is mout_epll (0), rate is 24000000
> audio-bus: source is mout_epll (0), rate is 24000000
> irda-bus: source is mout_epll (0), rate is 24000000
> camera: no parent clock specified
> CPU: found DTCM0 8k @ 00000000, not enabled
> CPU: moved DTCM0 8k to fffe8000, enabled
> CPU: found DTCM1 8k @ 00000000, not enabled
> CPU: moved DTCM1 8k to fffea000, enabled
> CPU: found ITCM0 8k @ 00000000, not enabled
> CPU: moved ITCM0 8k to fffe0000, enabled
> CPU: found ITCM1 8k @ 00000000, not enabled
> CPU: moved ITCM1 8k to fffe2000, enabled
> Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
> 32512 Kernel command line: console=ttySAC0,115200 root=/dev/ram
> init=/linuxrc initrd=0x51000000,6M ramdisk_size=6144
> PID hash table entries: 512 (order: -1, 2048 bytes)
> Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
> Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
> Memory: 128MB = 128MB total
> Memory: 120316k/120316k available, 10756k reserved, 0K highmem
> Virtual kernel memory layout:
>     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
>     DTCM    : 0xfffe8000 - 0xfffec000   (  16 kB)
>     ITCM    : 0xfffe0000 - 0xfffe4000   (  16 kB)
>     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
>     vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
>     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
>     modules : 0xbf000000 - 0xc0000000   (  16 MB)
>       .text : 0xc0008000 - 0xc02d7a64   (2879 kB)
>       .init : 0xc02d8000 - 0xc02f662c   ( 122 kB)
>       .data : 0xc02f8000 - 0xc0326420   ( 186 kB)
>        .bss : 0xc0327024 - 0xc0358858   ( 199 kB)
> SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1,
> Nodes=1 NR_IRQS:246
> VIC @f6000000: id 0x00041192, vendor 0x41
> VIC @f6010000: id 0x00041192, vendor 0x41
> sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every
> 4294967286ms Console: colour dummy device 80x30
> Calibrating delay loop... 353.89 BogoMIPS (lpj=1769472)
> pid_max: default: 32768 minimum: 301
> Mount-cache hash table entries: 512
> CPU: Testing write buffer coherency: ok
> Setting up static identity map for 0x5021c868 - 0x5021c8c4
> NET: Registered protocol family 16
> DMA: preallocated 256 KiB pool for atomic coherent allocations
> s3c64xx_dma_init: Registering DMA channels
> PL080: IRQ 73, at c8846000, channels 0..8
> PL080: IRQ 74, at c8848000, channels 8..16
> S3C6410: Initialising architecture
> bio: create slab <bio-0> at 0
> usbcore: registered new interface driver usbfs
> usbcore: registered new interface driver hub
> usbcore: registered new device driver usb
> s3c-i2c s3c2440-i2c.0: slave address 0x10
> s3c-i2c s3c2440-i2c.0: bus frequency set to 64 KHz
> s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter
> s3c-i2c s3c2440-i2c.1: slave address 0x10
> s3c-i2c s3c2440-i2c.1: bus frequency set to 64 KHz
> s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
> Trying to unpack rootfs image as initramfs...
> rootfs image is not initramfs (junk in compressed archive); looks
> like an initrd Freeing initrd memory: 6144K
> ROMFS MTD (C) 2007 Red Hat, Inc.
> io scheduler noop registered
> io scheduler deadline registered
> io scheduler cfq registered (default)
> start plist test
> end plist test
> s3c-fb s3c-fb: window 0: fb
> Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
> s3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 69) is a S3C6400/10
> console [ttySAC0] enabled
> s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10
> s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10
> s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10
> brd: module loaded
> loop: module loaded
> at24 0-0050: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
> at24 1-0057: 16384 byte 24c128 EEPROM, writable, 1 bytes/write
> S3C24XX NAND Driver, (c) 2004 Simtec Electronics
> ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
> s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
> s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus
> number 1 s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
^^^^^^^^^^^^^^^^^^^^^^^ Here one IRQ for USB is registered. Please
check if this not clash with s3c-hsotg (UDC) IRQ
>From your code I can tell, that you want to have the USB host and
device interfaces.

> usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
> usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
> usb usb1: Product: S3C24XX OHCI
> usb usb1: Manufacturer: Linux 3.6.0-rc1-00133-g42a579a-dirty ohci_hcd
> usb usb1: SerialNumber: s3c24xx
> hub 1-0:1.0: USB hub found
> hub 1-0:1.0: 2 ports detected
> Unable to handle kernel NULL pointer dereference at virtual address
> 000000e0 pgd = c0004000
> [000000e0] *pgd=00000000
> Internal error: Oops: 5 [#1] ARM
> Modules linked in:
> CPU: 0    Not tainted  (3.6.0-rc1-00133-g42a579a-dirty #19)
> PC is at s3c_hsotg_handle_outdone+0x40/0xdc
> LR is at s3c_hsotg_irq+0x5a0/0x5fc

It is strange that no previous information about s3c-hsotg is in dmesg.
The only one which appears is the null pointer dereference. 

> pc : [<c01a3408>]    lr : [<c01a4eb8>]    psr: 80000193
> sp : c782fd18  ip : 00000000  fp : c139301c
> r10: 00000000  r9 : 00000008  r8 : 00000000
> r7 : c1393010  r6 : 000000b0  r5 : 00000002  r4 : c1392300
> r3 : 000000b0  r2 : 00000000  r1 : 00080200  r0 : c1393010
> Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> Control: 00c5387d  Table: 50004008  DAC: 00000017
> Process swapper (pid: 1, stack limit = 0xc782e268)
> Stack: (0xc782fd18 to 0xc7830000)
> fd00:                                                       c1392300
> c1392300 fd20: 00000000 c1393010 00000010 c01a4eb8 c782fd84 c1393078
> 000012d0 c1392300 fd40: c1392300 00000000 00000000 0000005a c0310aec
> c0310b54 c03263c1 c0056e44 fd60: c0325c8c 00000000 22222222 c0310aec
> c1392300 c0310b3c 00000000 c0327328 fd80: c0310b1c c0327324 c0327040
> c0056fe4 c0310aec c0310b3c 00000000 c00595e8 fda0: 0000005a c0318d68
> 00000000 c0056a00 0000005a c000efdc c0327350 00000001 fdc0: c782fde8
> c0008508 c021c7c0 60000013 ffffffff c782fe1c c0310b3c c0310b1c fde0:
> 60000013 c000dd80 c0310b3c c782c000 ffffffff 00000001 60000013
> c0310aec fe00: c1392300 0000005a c0310b3c c0310b1c 60000013 c0327040
> f6010000 c782fe30 fe20: c021c7bc c021c7c0 60000013 ffffffff c01a4918
> c0057d48 c138bc90 c008c344 fe40: c01a4918 00000000 00000000 c1393010
> 0000005a c1392300 c0310aec c00581e4 fe60: c138bcd0 00000000 c01a4918
> 0000005a c1393010 c02ede10 c0308998 c0059e00 fe80: c784fe60 c1393010
> c784fe60 0000005a c1393010 c0308990 c03229e8 c0308998 fea0: c02f1818
> c0218c7c 00000000 c784fe60 c1393010 00000000 c03089cc 60000013 fec0:
> c7851940 00000000 c03229e8 c0308998 c0308998 c03229e8 c03229e8
> c0357938 fee0: c02ede10 c02f1818 c0327040 c016ba7c c0308998 c016a6f0
> c0308998 c03089cc ff00: c03229e8 c016a880 c782e000 c016a90c 00000000
> c782ff20 c03229e8 c0168fe8 ff20: c7803878 c7823ac0 c031e0c8 c02875cc
> c138c480 c03229e8 c031e0c8 c01697b8 ff40: c02875cc c03229e8 00000007
> 00000000 c03229e8 00000007 c0327040 c016aebc ff60: 00000000 c02f180c
> 00000007 c0327040 c782e000 c00085f0 c030c378 00000000 ff80: 00000053
> 00000000 c0459cf9 c00377dc 00000006 00000006 c02c1380 c02a0130 ffa0:
> c030c378 c02f6380 c02f180c 00000007 c0327040 00000053 c02d81b0
> c02f1818 ffc0: 00000000 c02d830c 00000006 00000006 c02d81b0 00000000
> 00000000 c02d821c ffe0: c000f0ac 00000013 00000000 00000000 00000000
> c000f0ac 0002fbf7 00007fff [<c01a3408>]
> (s3c_hsotg_handle_outdone+0x40/0xdc) from [<c01a4eb8>]
> (s3c_hsotg_irq+0x5a0/0x5fc) [<c01a4eb8>] (s3c_hsotg_irq+0x5a0/0x5fc)
> from [<c0056e44>] (handle_irq_event_percpu+0x50/0x1b4) [<c0056e44>]
> (handle_irq_event_percpu+0x50/0x1b4) from [<c0056fe4>]
> (handle_irq_event+0x3c/0x5c) [<c0056fe4>]
> (handle_irq_event+0x3c/0x5c) from [<c00595e8>]
> (handle_level_irq+0x8c/0x118) [<c00595e8>]
> (handle_level_irq+0x8c/0x118) from [<c0056a00>]
> (generic_handle_irq+0x38/0x44) [<c0056a00>]
> (generic_handle_irq+0x38/0x44) from [<c000efdc>]
> (handle_IRQ+0x30/0x84) [<c000efdc>] (handle_IRQ+0x30/0x84) from
> [<c0008508>] (vic_handle_irq+0x68/0xa8) [<c0008508>]
> (vic_handle_irq+0x68/0xa8) from [<c000dd80>] (__irq_svc+0x40/0x54)
> Exception stack(0xc782fde8 to 0xc782fe30) fde0:
> c0310b3c c782c000 ffffffff 00000001 60000013 c0310aec fe00: c1392300
> 0000005a c0310b3c c0310b1c 60000013 c0327040 f6010000 c782fe30 fe20:
> c021c7bc c021c7c0 60000013 ffffffff [<c000dd80>]
> (__irq_svc+0x40/0x54) from [<c021c7c0>]
> (_raw_spin_unlock_irqrestore+0x10/0x14) [<c021c7c0>]
> (_raw_spin_unlock_irqrestore+0x10/0x14) from [<c0057d48>]
> (__setup_irq+0x184/0x408) [<c0057d48>] (__setup_irq+0x184/0x408) from
> [<c00581e4>] (request_threaded_irq+0xc4/0x12c) [<c00581e4>]
> (request_threaded_irq+0xc4/0x12c) from [<c0059e00>]
> (devm_request_threaded_irq+0x58/0x8c) [<c0059e00>]
> (devm_request_threaded_irq+0x58/0x8c) from [<c0218c7c>]
> (s3c_hsotg_probe+0xdc/0x5c0) [<c0218c7c>]
> (s3c_hsotg_probe+0xdc/0x5c0) from [<c016ba7c>]
> (platform_drv_probe+0x18/0x1c) [<c016ba7c>]
> (platform_drv_probe+0x18/0x1c) from [<c016a6f0>]
> (driver_probe_device+0x78/0x208) [<c016a6f0>]
> (driver_probe_device+0x78/0x208) from [<c016a90c>]
> (__driver_attach+0x8c/0x90) [<c016a90c>] (__driver_attach+0x8c/0x90)
> from [<c0168fe8>] (bus_for_each_dev+0x60/0x8c) [<c0168fe8>]
> (bus_for_each_dev+0x60/0x8c) from [<c01697b8>]
> (bus_add_driver+0xac/0x248) [<c01697b8>] (bus_add_driver+0xac/0x248)
> from [<c016aebc>] (driver_register+0x58/0x14c)
> [<c016aebc>] (driver_register+0x58/0x14c) from [<c00085f0>]
> (do_one_initcall+0x34/0x17c)
> [<c00085f0>] (do_one_initcall+0x34/0x17c) from [<c02d830c>]
> (kernel_init+0xf0/0x1bc)
> [<c02d830c>] (kernel_init+0xf0/0x1bc) from [<c000f0ac>]
> (kernel_thread_exit+0x0/0x8)
> Code: e0433105 e0653003 e1a03183 e0826003 (e5964030)
> ---[ end trace 91f15b573a676870 ]---
> Kernel panic - not syncing: Fatal exception in interrupt
> 



-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5
  2012-08-06 13:14   ` Lukasz Majewski
  2012-08-07  3:04     ` Peiyong Feng
@ 2012-08-07 16:34     ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2012-08-07 16:34 UTC (permalink / raw)
  To: Lukasz Majewski; +Cc: balbi, Peiyong Feng, linux-usb, linux-kernel

On Mon, Aug 06, 2012 at 03:14:36PM +0200, Lukasz Majewski wrote:
> > On Mon, Aug 06, 2012 at 06:12:05PM +0800, Peiyong Feng wrote:
> > > I got a kernel panic when try hsotg of ok6410 which is based on
> > > s3c6410:

> As you said, you are using the ok6410. And it is "based" on the s3c6410
> CPU. S3C6410 is a single core CPU. I assume that ok6410 is also single
> core?

FWIW I think what the above means is "I am using the ok6410 board which
has a s3c6410 SoC on it".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5
  2012-08-07  9:34       ` Lukasz Majewski
@ 2012-08-08  5:02         ` Peiyong Feng
  2012-08-08  6:13           ` Lukasz Majewski
  0 siblings, 1 reply; 9+ messages in thread
From: Peiyong Feng @ 2012-08-08  5:02 UTC (permalink / raw)
  To: Lukasz Majewski; +Cc: balbi, linux-usb, linux-kernel

2012/8/7 Lukasz Majewski <l.majewski@samsung.com>:
> On Tue, 07 Aug 2012 11:04:10 +0800
> Peiyong Feng <peiyong.feng.kernel@gmail.com> wrote:
>
>> 2012/8/6 Lukasz Majewski <l.majewski@samsung.com>:
>> > Hi,
>> >
>> >> Hi,
>> >>
>> >> On Mon, Aug 06, 2012 at 06:12:05PM +0800, Peiyong Feng wrote:
>> >> > I got a kernel panic when try hsotg of ok6410 which is based on
>> >> > s3c6410:
>> > As you said, you are using the ok6410. And it is "based" on the
>> > s3c6410 CPU. S3C6410 is a single core CPU. I assume that ok6410 is
>> > also single core?
>> yes
>> >
>> >> >
>> >> >
>> >> > cdc_acm: USB Abstract Control Model driver for USB modems and
>> >> > ISDN adapters Unable to handle kernel NULL pointer dereference at
>> >> > virtual address 00000100
>> >
>> >> > pgd = c0004000
>> >> > [00000100] *pgd=00000000
>> >> > Internal error: Oops: 5 [#1] ARM
>> >> > Modules linked in:
>> >> > CPU: 0    Not tainted  (3.5.0 #9)
>> >> > PC is at s3c_hsotg_handle_outdone+0x44/0x158
>> >> > LR is at s3c_hsotg_irq+0x75c/0x804
>> >> > pc : [<c023e7fc>]    lr : [<c024061c>]    psr: 60000193
>> >> > sp : c782fd20  ip : 00000029  fp : c13a1460
>> >> > r10: 00000000  r9 : 00000008  r8 : 000000d0
>> >> > r7 : c13a1400  r6 : 00000002  r5 : 00000000  r4 : 00060002
>> >> > r3 : 000000d0  r2 : 00000000  r1 : 00080200  r0 : c13a1400
>> >> > Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment
>> >> > kernel Control: 00c5387d  Table: 50004008  DAC: 00000017
>> >> > Process swapper (pid: 1, stack limit = 0xc782e268)
>> >> > Stack: (0xc782fd20 to 0xc7830000)
>> >> > fd20: c13a1460 c0200f64 00000000 00060002 00000000 00000002
>> >> > c13a1400 00000010 fd40: 00000000 c024061c 00060002 00000000
>> >> > 00000002 00000008 c782fda0 c139a5c0 fd60: c139a5c0 00000000
>> >> > 00000000 0000005a c04cc52c c04cc594 c04ea5fe c00565c0 fd80:
>> >> > 00000000 00000000 00000000 c04cc52c c139a5c0 c04cc57c 00000000
>> >> > c04eb328 fda0: c04cc55c c04eb324 c04c44c0 c0056768 c04cc52c
>> >> > c04cc57c 00000000 c0058d64 fdc0: 0000005a c04d7dd8 00000000
>> >> > c005617c 0000005a c000efbc c04eb350 00000001 fde0: c782fe08
>> >> > c000853c c036c540 60000013 ffffffff c782fe3c c04cc57c c04cc55c
>> >> > fe00: 60000013 c000dd80 c04cc57c c782c000 ffffffff 00000001
>> >> > 60000013 c04cc52c fe20: c139a5c0 0000005a c04cc57c c04cc55c
>> >> > 60000013 c04c44c0 f6010000 c782fe50 fe40: c036c53c c036c540
>> >> > 60000013 ffffffff c023fec0 c00574c8 00000000 c008b2dc fe60:
>> >> > c023fec0 00000000 00000000 c13a1400 0000005a c139a5c0 c04cc52c
>> >> > c0057960 fe80: 0000005a c13a1400 c04c44b8 00000000 c051d238
>> >> > c049b0ec 00000000 c03688fc fea0: c7853e60 c13a1400 c7804f80
>> >> > 00000000 c04c44f4 60000013 c7855a80 00000000 fec0: c04e1bb4
>> >> > c04c44c0 c04c44c0 c04e1bb4 c04e1bb4 c051d238 c049b0ec 00000000
>> >> > fee0: c04eb040 c020588c c04c44c0 c0204524 c04c44c0 c04c44f4
>> >> > c04e1bb4 c02046ac ff00: c13a01e0 c0204738 00000000 c782ff18
>> >> > c04e1bb4 c0202e30 c7803878 c7823700 ff20: c04dd1d0 c040b8d4
>> >> > c04e1bb4 c04e1bb4 c04dd1d0 c0203600 c040b8d4 c01b8568 ff40:
>> >> > 00000000 00000000 c04e1bb4 00000007 c04eb040 c782e000 c04a65e0
>> >> > c0204ce8 ff60: 00000000 c04a65d4 00000007 c04eb040 c782e000
>> >> > c0008628 c04c7ea0 00000000 ff80: 0000009c 00000000 c0625cf9
>> >> > c0037178 00000006 00000006 c0461b84 c042cee8 ffa0: c04c7ea0
>> >> > c04abdd4 c04a65d4 00000007 c04eb040 0000009c c04841b0 c04a65e0
>> >> > ffc0: 00000000 c048430c 00000006 00000006 c04841b0 00000000
>> >> > 00000000 c048421c ffe0: c000f08c 00000013 00000000 00000000
>> >> > 00000000 c000f08c 00000000 00000000 [<c023e7fc>]
>> >> > (s3c_hsotg_handle_outdone+0x44/0x158) from [<c024061c>]
>> >> > (s3c_hsotg_irq+0x75c/0x804) [<c024061c>]
>> >> > (s3c_hsotg_irq+0x75c/0x804) from [<c00565c0>]
>> >> > (handle_irq_event_percpu+0x50/0x1bc) [<c00565c0>]
>> >> > (handle_irq_event_percpu+0x50/0x1bc) from [<c0056768>]
>> >> > (handle_irq_event+0x3c/0x5c) [<c0056768>]
>> >> > (handle_irq_event+0x3c/0x5c) from [<c0058d64>]
>> >> > (handle_level_irq+0x8c/0x118) [<c0058d64>]
>> >> > (handle_level_irq+0x8c/0x118) from [<c005617c>]
>> >> > (generic_handle_irq+0x38/0x44) [<c005617c>]
>> >> > (generic_handle_irq+0x38/0x44) from [<c000efbc>]
>> >> > (handle_IRQ+0x30/0x84) [<c000efbc>] (handle_IRQ+0x30/0x84) from
>> >> > [<c000853c>] (vic_handle_irq+0x68/0xa8) [<c000853c>]
>> >> > (vic_handle_irq+0x68/0xa8) from [<c000dd80>]
>> >> > (__irq_svc+0x40/0x60) Exception stack(0xc782fe08 to 0xc782fe50)
>> >> > fe00: c04cc57c c782c000 ffffffff 00000001 60000013 c04cc52c fe20:
>> >> > c139a5c0 0000005a c04cc57c c04cc55c 60000013 c04c44c0 f6010000
>> >> > c782fe50 fe40: c036c53c c036c540 60000013 ffffffff [<c000dd80>]
>> >> > (__irq_svc+0x40/0x60) from [<c036c540>]
>> >> > (_raw_spin_unlock_irqrestore+0x10/0x14) [<c036c540>]
>> >> > (_raw_spin_unlock_irqrestore+0x10/0x14) from [<c00574c8>]
>> >> > (__setup_irq+0x178/0x3f8) [<c00574c8>] (__setup_irq+0x178/0x3f8)
>> >> > from [<c0057960>] (request_threaded_irq+0xc4/0x12c) [<c0057960>]
>> >> > (request_threaded_irq+0xc4/0x12c) from [<c03688fc>]
>> >> > (s3c_hsotg_probe+0x14c/0x700) [<c03688fc>]
>> >> > (s3c_hsotg_probe+0x14c/0x700) from [<c020588c>]
>> >> > (platform_drv_probe+0x18/0x1c) [<c020588c>]
>> >> > (platform_drv_probe+0x18/0x1c) from [<c0204524>]
>> >> > (driver_probe_device+0x78/0x200) [<c0204524>]
>> >> > (driver_probe_device+0x78/0x200) from [<c0204738>]
>> >> > (__driver_attach+0x8c/0x90) [<c0204738>]
>> >> > (__driver_attach+0x8c/0x90) from [<c0202e30>]
>> >> > (bus_for_each_dev+0x60/0x8c) [<c0202e30>]
>> >> > (bus_for_each_dev+0x60/0x8c) from [<c0203600>]
>> >> > (bus_add_driver+0xac/0x250) [<c0203600>]
>> >> > (bus_add_driver+0xac/0x250) from [<c0204ce8>]
>> >> > (driver_register+0x58/0x130) [<c0204ce8>]
>> >> > (driver_register+0x58/0x130) from [<c0008628>]
>> >> > (do_one_initcall+0x34/0x17c) [<c0008628>]
>> >> > (do_one_initcall+0x34/0x17c) from [<c048430c>]
>> >> > (kernel_init+0xf0/0x1bc) [<c048430c>] (kernel_init+0xf0/0x1bc)
>> >> > from [<c000f08c>] (kernel_thread_exit+0x0/0x8) Code: e0433106
>> >> > e0833006 e1a03183 e0828003 (e5984030) ---[ end trace
>> >> > 2ea4e574318ecf99 ]--- Kernel panic - not syncing: Fatal
>> >> > exception in interrupt
>> >> > -----------------------------------------------------------------------------------
>> >> >
>> >> >
>> >> > When I try locate the source using arm-linux-gdb, I got this:
>> >> > -------------------------------------------------------------
>> >> > GNU gdb (Sourcery G++ Lite 2008q3-72) 6.8.50.20080821-cvs
>> >> > Copyright (C) 2008 Free Software Foundation, Inc.
>> >> > License GPLv3+: GNU GPL version 3 or later
>> >> > <http://gnu.org/licenses/gpl.html> This is free software: you are
>> >> > free to change and redistribute it. There is NO WARRANTY, to the
>> >> > extent permitted by law.  Type "show copying" and "show warranty"
>> >> > for details. This GDB was configured as "--host=i686-pc-linux-gnu
>> >> > --target=arm-none-linux-gnueabi".
>> >> > For bug reporting instructions, please see:
>> >> > <https://support.codesourcery.com/GNUToolchain/>...
>> >> > (gdb) l *(s3c_hsotg_handle_outdone+0x44)
>> >> > 0xc023e7fc is in s3c_hsotg_handle_outdone
>> >> > (drivers/usb/gadget/s3c-hsotg.c:1553). 1548 static void
>> >> > s3c_hsotg_handle_outdone(struct s3c_hsotg *hsotg,
>> >> > 1549                                             int epnum, bool
>> >> > was_setup) 1550     { 1551          u32 epsize =
>> >> > readl(hsotg->regs + DOEPTSIZ(epnum)); 1552          struct
>> >> > s3c_hsotg_ep *hs_ep = &hsotg->eps[epnum]; 1553
>> >> > struct s3c_hsotg_req *hs_req = hs_ep->req; 1554
>> >> > struct usb_request *req = &hs_req->req; 1555
>> >> > unsigned size_left = DxEPTSIZ_XferSize_GET(epsize);
>> >> > 1556                int result = 0; 1557
>> >> > (gdb)
>> >> >
>> >> >
>> >> >
>> >> > I also try the old linux like 2.6.36, I works fine.
>> >>
>> >> Lukasz, any ideas ?
>> >>
>> >
>> > I see, that you are using 3.5.0 kernel.
>> > During the 3.5 kernel development cycle, I've discovered very nasty
>> > SMP related bug. It is fixed at 3.6-rc1 code.
>> >
>> > Relevant commits are:
>> > 22258f4 usb: hsotg: samsung: Replace endpoint specific locks with a
>> > global lock
>> > 2b19a52 usb: hsotg: samsung: Protect the udc_stop routine with
>> > spinlock 5ad1d31 usb: hsotg: samsung: smp Provide *_lock functions
>> > abstraction layer for SMP SoCs
>> >
>> > Above commits are already available at 3.6-rc1.
>> >
>> > Would it be possible to cross compile 3.6-rc1 kernel for your
>> > platform and test the USB?
>> >
>> >
>> >
>> > I'd like to ask you for #define DEBUG above includes (to enable
>> > dev_dbg()) calls at ./drivers/usb/gadget/s3c-hsotg.c file.
>
> Please enable the debug at s3c-hsotg.c driver and then paste the
> dmesg/debug output.
I have defined DEGUG in s3c-hsotg.c
>
>> >
>> > Afterwards please, paste the log (dmesg) from booting your target
>> > device.
>> Still canot work, log:
>> Starting kernel ...
>>
>> Uncompressing Linux... done, booting the kernel.
>> Booting Linux on physical CPU 0
>> Linux version 3.6.0-rc1-00133-g42a579a-dirty (root@xxxx) (gcc version
>> 4.3.2 (Sourcery G++ Lite 2008q3-72) ) 2
>> CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7),
>> cr=00c5387d CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing
>> instruction cache Machine: SMDK6410
>> Memory policy: ECC disabled, Data cache writeback
>> CPU S3C6410 (id 0x36410101)
>> S3C24XX Clocks, Copyright 2004 Simtec Electronics
>> camera: no parent clock specified
>> S3C64XX: PLL settings, A=532000000, M=532000000, E=24000000
>> S3C64XX: HCLK2=266000000, HCLK=133000000, PCLK=66500000
>> mout_apll: source is fout_apll (1), rate is 532000000
>> mout_epll: source is epll (1), rate is 24000000
>> mout_mpll: source is mpll (1), rate is 532000000
>> usb-bus-host: source is clk_48m (0), rate is 48000000
>> audio-bus: source is mout_epll (0), rate is 24000000
>> audio-bus: source is mout_epll (0), rate is 24000000
>> audio-bus: source is mout_epll (0), rate is 24000000
>> irda-bus: source is mout_epll (0), rate is 24000000
>> camera: no parent clock specified
>> CPU: found DTCM0 8k @ 00000000, not enabled
>> CPU: moved DTCM0 8k to fffe8000, enabled
>> CPU: found DTCM1 8k @ 00000000, not enabled
>> CPU: moved DTCM1 8k to fffea000, enabled
>> CPU: found ITCM0 8k @ 00000000, not enabled
>> CPU: moved ITCM0 8k to fffe0000, enabled
>> CPU: found ITCM1 8k @ 00000000, not enabled
>> CPU: moved ITCM1 8k to fffe2000, enabled
>> Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
>> 32512 Kernel command line: console=ttySAC0,115200 root=/dev/ram
>> init=/linuxrc initrd=0x51000000,6M ramdisk_size=6144
>> PID hash table entries: 512 (order: -1, 2048 bytes)
>> Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
>> Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
>> Memory: 128MB = 128MB total
>> Memory: 120316k/120316k available, 10756k reserved, 0K highmem
>> Virtual kernel memory layout:
>>     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
>>     DTCM    : 0xfffe8000 - 0xfffec000   (  16 kB)
>>     ITCM    : 0xfffe0000 - 0xfffe4000   (  16 kB)
>>     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
>>     vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
>>     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
>>     modules : 0xbf000000 - 0xc0000000   (  16 MB)
>>       .text : 0xc0008000 - 0xc02d7a64   (2879 kB)
>>       .init : 0xc02d8000 - 0xc02f662c   ( 122 kB)
>>       .data : 0xc02f8000 - 0xc0326420   ( 186 kB)
>>        .bss : 0xc0327024 - 0xc0358858   ( 199 kB)
>> SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1,
>> Nodes=1 NR_IRQS:246
>> VIC @f6000000: id 0x00041192, vendor 0x41
>> VIC @f6010000: id 0x00041192, vendor 0x41
>> sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every
>> 4294967286ms Console: colour dummy device 80x30
>> Calibrating delay loop... 353.89 BogoMIPS (lpj=1769472)
>> pid_max: default: 32768 minimum: 301
>> Mount-cache hash table entries: 512
>> CPU: Testing write buffer coherency: ok
>> Setting up static identity map for 0x5021c868 - 0x5021c8c4
>> NET: Registered protocol family 16
>> DMA: preallocated 256 KiB pool for atomic coherent allocations
>> s3c64xx_dma_init: Registering DMA channels
>> PL080: IRQ 73, at c8846000, channels 0..8
>> PL080: IRQ 74, at c8848000, channels 8..16
>> S3C6410: Initialising architecture
>> bio: create slab <bio-0> at 0
>> usbcore: registered new interface driver usbfs
>> usbcore: registered new interface driver hub
>> usbcore: registered new device driver usb
>> s3c-i2c s3c2440-i2c.0: slave address 0x10
>> s3c-i2c s3c2440-i2c.0: bus frequency set to 64 KHz
>> s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter
>> s3c-i2c s3c2440-i2c.1: slave address 0x10
>> s3c-i2c s3c2440-i2c.1: bus frequency set to 64 KHz
>> s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
>> Trying to unpack rootfs image as initramfs...
>> rootfs image is not initramfs (junk in compressed archive); looks
>> like an initrd Freeing initrd memory: 6144K
>> ROMFS MTD (C) 2007 Red Hat, Inc.
>> io scheduler noop registered
>> io scheduler deadline registered
>> io scheduler cfq registered (default)
>> start plist test
>> end plist test
>> s3c-fb s3c-fb: window 0: fb
>> Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
>> s3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 69) is a S3C6400/10
>> console [ttySAC0] enabled
>> s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10
>> s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10
>> s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10
>> brd: module loaded
>> loop: module loaded
>> at24 0-0050: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
>> at24 1-0057: 16384 byte 24c128 EEPROM, writable, 1 bytes/write
>> S3C24XX NAND Driver, (c) 2004 Simtec Electronics
>> ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
>> s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
>> s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus
>> number 1 s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
> ^^^^^^^^^^^^^^^^^^^^^^^ Here one IRQ for USB is registered. Please
> check if this not clash with s3c-hsotg (UDC) IRQ
Well, I also tested in linux-2.6.36, it works ok, here is the log:

=================================================
Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.36 (root@archermind) (gcc version 4.3.2 (Sourcery
G++ Lite 2008q3-72) ) #21 Wed Aug 8 11:40:58 C2
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: SMDK6410
Memory policy: ECC disabled, Data cache writeback
CPU S3C6410 (id 0x36410101)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
camera: no parent clock specified
S3C64XX: PLL settings, A=532000000, M=532000000, E=24000000
S3C64XX: HCLK2=266000000, HCLK=133000000, PCLK=66500000
mout_apll: source is fout_apll (1), rate is 532000000
mout_epll: source is epll (1), rate is 24000000
mout_mpll: source is mpll (1), rate is 532000000
mmc_bus: source is mout_epll (0), rate is 24000000
mmc_bus: source is mout_epll (0), rate is 24000000
mmc_bus: source is mout_epll (0), rate is 24000000
usb-bus-host: source is clk_48m (0), rate is 48000000
uclk1: source is dout_mpll (1), rate is 66500000
spi-bus: source is mout_epll (0), rate is 24000000
spi-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
irda-bus: source is mout_epll (0), rate is 24000000
camera: no parent clock specified
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: console=ttySAC0,115200 root=/dev/ram
init=/linuxrc initrd=0x51000000,6M ramdisk_size=6144
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 120932k/120932k available, 10140k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xff600000 - 0xffe00000   (   8 MB)
    vmalloc : 0xc8800000 - 0xe0000000   ( 376 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0021000   ( 100 kB)
      .text : 0xc0021000 - 0xc025e000   (2292 kB)
      .data : 0xc0274000 - 0xc02944c0   ( 130 kB)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
        RCU-based detection of stalled CPUs is disabled.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:246
VIC @f4000000: id 0x00041192, vendor 0x41
VIC @f4010000: id 0x00041192, vendor 0x41
Console: colour dummy device 80x30
console [ttySAC0] enabled
Calibrating delay loop... 530.84 BogoMIPS (lpj=2654208)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
s3c64xx_dma_init: Registering DMA channels
s3c64xx_dma_init1: registering DMA 0 (c8808100)
s3c64xx_dma_init1: registering DMA 1 (c8808120)
s3c64xx_dma_init1: registering DMA 2 (c8808140)
s3c64xx_dma_init1: registering DMA 3 (c8808160)
s3c64xx_dma_init1: registering DMA 4 (c8808180)
s3c64xx_dma_init1: registering DMA 5 (c88081a0)
s3c64xx_dma_init1: registering DMA 6 (c88081c0)
s3c64xx_dma_init1: registering DMA 7 (c88081e0)
PL080: IRQ 73, at c8808000
s3c64xx_dma_init1: registering DMA 8 (c880c100)
s3c64xx_dma_init1: registering DMA 9 (c880c120)
s3c64xx_dma_init1: registering DMA 10 (c880c140)
s3c64xx_dma_init1: registering DMA 11 (c880c160)
s3c64xx_dma_init1: registering DMA 12 (c880c180)
s3c64xx_dma_init1: registering DMA 13 (c880c1a0)
s3c64xx_dma_init1: registering DMA 14 (c880c1c0)
s3c64xx_dma_init1: registering DMA 15 (c880c1e0)
PL080: IRQ 74, at c880c000
S3C6410: Initialising architecture
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c-i2c s3c2440-i2c.0: slave address 0x10
s3c-i2c s3c2440-i2c.0: bus frequency set to 64 KHz
s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter
s3c-i2c s3c2440-i2c.1: slave address 0x10
s3c-i2c s3c2440-i2c.1: bus frequency set to 64 KHz
s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (junk in compressed archive); looks like an initrd
Freeing initrd memory: 6144K
ROMFS MTD (C) 2007 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
s3c-fb s3c-fb: window 0: fb
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
s3c6400-uart.0: s3c2410_serial0 at MMIO 0x7f005000 (irq = 16) is a S3C6400/10
s3c6400-uart.1: s3c2410_serial1 at MMIO 0x7f005400 (irq = 20) is a S3C6400/10
s3c6400-uart.2: s3c2410_serial2 at MMIO 0x7f005800 (irq = 24) is a S3C6400/10
s3c6400-uart.3: s3c2410_serial3 at MMIO 0x7f005c00 (irq = 28) is a S3C6400/10
brd: module loaded
loop: module loaded
at24 0-0050: 1024 byte 24c08 EEPROM (writable)
at24 1-0057: 16384 byte 24c128 EEPROM (writable)
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: S3C24XX OHCI
usb usb1: Manufacturer: Linux 2.6.36 ohci_hcd
usb usb1: SerialNumber: s3c24xx
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
s3c-hsotg s3c-hsotg: regs c8840000, irq 90
s3c-hsotg s3c-hsotg: s3c_hsotg_corereset: reset failed, GRSTCTL=80000001
s3c-hsotg s3c-hsotg: GRXFSIZ=0x00001800, GNPTXFSIZ=0x18001800
s3c-hsotg s3c-hsotg: shared fifos
s3c-hsotg s3c-hsotg: cannot create debug root
s3c-hsotg s3c-hsotg: DCFG=0x00200000, DCTL=0x00000002, DIEPMSK=0000000f
s3c-hsotg s3c-hsotg: GAHBCFG=0x00000000, 0x44=0x00000000
s3c-hsotg s3c-hsotg: GRXFSIZ=0x00000800, GNPTXFSIZ=0x04000800
s3c-hsotg s3c-hsotg: DPTx[1] FSize=768, StAddr=0x00000f00
s3c-hsotg s3c-hsotg: DPTx[2] FSize=768, StAddr=0x00001200
s3c-hsotg s3c-hsotg: DPTx[3] FSize=768, StAddr=0x00001500
s3c-hsotg s3c-hsotg: DPTx[4] FSize=768, StAddr=0x00001800
s3c-hsotg s3c-hsotg: DPTx[5] FSize=768, StAddr=0x00001b00
s3c-hsotg s3c-hsotg: DPTx[6] FSize=768, StAddr=0x00001e00
s3c-hsotg s3c-hsotg: DPTx[7] FSize=768, StAddr=0x00002100
s3c-hsotg s3c-hsotg: DPTx[8] FSize=768, StAddr=0x00002400
s3c-hsotg s3c-hsotg: DPTx[9] FSize=768, StAddr=0x00002700
s3c-hsotg s3c-hsotg: DPTx[10] FSize=768, StAddr=0x00002a00
s3c-hsotg s3c-hsotg: DPTx[11] FSize=768, StAddr=0x00002d00
s3c-hsotg s3c-hsotg: DPTx[12] FSize=768, StAddr=0x00003000
s3c-hsotg s3c-hsotg: DPTx[13] FSize=768, StAddr=0x00003300
s3c-hsotg s3c-hsotg: DPTx[14] FSize=768, StAddr=0x00003600
s3c-hsotg s3c-hsotg: DPTx[15] FSize=768, StAddr=0x00003900
s3c-hsotg s3c-hsotg: ep0-in: EPCTL=0x00008000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep0-out: EPCTL=0x00008000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep1-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep1-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep2-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep2-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep3-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep3-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep4-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep4-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep5-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep5-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep6-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep6-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep7-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep7-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep8-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep8-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep9-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep9-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep10-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep10-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep11-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep11-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep12-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep12-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep13-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep13-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep14-in: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: ep14-out: EPCTL=0x00000000, SIZ=0x00000000, DMA=0x00000000
s3c-hsotg s3c-hsotg: DVBUSDIS=0x000017d7, DVBUSPULSE=000005b8
g_ether gadget: using random self ethernet address
g_ether gadget: using random host ethernet address
usb0: MAC f2:17:0a:35:30:d1
usb0: HOST MAC b6:57:d6:a4:e9:f7
g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
g_ether gadget: g_ether ready
s3c-hsotg s3c-hsotg: EP0: DIEPCTL0=0x00008000, DOEPCTL0=0x00008000
s3c-hsotg s3c-hsotg: DCTL=0x00000002
s3c-hsotg s3c-hsotg: EP0: DIEPCTL0=0x00008000, DOEPCTL0=0x80008000
s3c-hsotg s3c-hsotg: S3C_GINTSTS_USBSusp
s3c-hsotg s3c-hsotg: S3C_GINTSTS_USBSusp
s3c-hsotg s3c-hsotg: bound driver g_ether
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c-rtc s3c64xx-rtc: rtc disabled, re-enabling
s3c-rtc s3c64xx-rtc: rtc core: registered s3c as rtc0
i2c /dev entries driver
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.0: clock source 2: mmc_bus (24000000 Hz)
mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
s3c6400_setup_sdhci_cfg_card: CTRL 2=c0004120, 3=80808080
s3c-rtc s3c64xx-rtc: setting system clock to 2001-06-14 07:18:06 UTC (992503086)
RAMDISK: Couldn't find valid RAM disk image starting at 0.
s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
List of all partitions:
No filesystem could mount root, tried:  ext3 ext2 cramfs romfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
[<c0027648>] (unwind_backtrace+0x0/0xec) from [<c01c96d8>] (panic+0x54/0x174)
[<c01c96d8>] (panic+0x54/0x174) from [<c0009018>] (mount_block_root+0x25c/0x2ac)
[<c0009018>] (mount_block_root+0x25c/0x2ac) from [<c0009230>]
(prepare_namespace+0x164/0x1bc)
[<c0009230>] (prepare_namespace+0x164/0x1bc) from [<c00085f4>]
(kernel_init+0x10c/0x14c)
[<c00085f4>] (kernel_init+0x10c/0x14c) from [<c0022e0c>]
(kernel_thread_exit+0x0/0x8)
s3c-hsotg s3c-hsotg: new device is high-speed
s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
s3c-hsotg s3c-hsotg: new device is high-speed
s3c-hsotg s3c-hsotg: new address 58
g_ether gadget: high speed config #1: CDC Ethernet (ECM)


> From your code I can tell, that you want to have the USB host and
> device interfaces.
>
>> usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
>> usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
>> usb usb1: Product: S3C24XX OHCI
>> usb usb1: Manufacturer: Linux 3.6.0-rc1-00133-g42a579a-dirty ohci_hcd
>> usb usb1: SerialNumber: s3c24xx
>> hub 1-0:1.0: USB hub found
>> hub 1-0:1.0: 2 ports detected
>> Unable to handle kernel NULL pointer dereference at virtual address
>> 000000e0 pgd = c0004000
>> [000000e0] *pgd=00000000
>> Internal error: Oops: 5 [#1] ARM
>> Modules linked in:
>> CPU: 0    Not tainted  (3.6.0-rc1-00133-g42a579a-dirty #19)
>> PC is at s3c_hsotg_handle_outdone+0x40/0xdc
>> LR is at s3c_hsotg_irq+0x5a0/0x5fc
>
> It is strange that no previous information about s3c-hsotg is in dmesg.
> The only one which appears is the null pointer dereference.
>
>> pc : [<c01a3408>]    lr : [<c01a4eb8>]    psr: 80000193
>> sp : c782fd18  ip : 00000000  fp : c139301c
>> r10: 00000000  r9 : 00000008  r8 : 00000000
>> r7 : c1393010  r6 : 000000b0  r5 : 00000002  r4 : c1392300
>> r3 : 000000b0  r2 : 00000000  r1 : 00080200  r0 : c1393010
>> Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
>> Control: 00c5387d  Table: 50004008  DAC: 00000017
>> Process swapper (pid: 1, stack limit = 0xc782e268)
>> Stack: (0xc782fd18 to 0xc7830000)
>> fd00:                                                       c1392300
>> c1392300 fd20: 00000000 c1393010 00000010 c01a4eb8 c782fd84 c1393078
>> 000012d0 c1392300 fd40: c1392300 00000000 00000000 0000005a c0310aec
>> c0310b54 c03263c1 c0056e44 fd60: c0325c8c 00000000 22222222 c0310aec
>> c1392300 c0310b3c 00000000 c0327328 fd80: c0310b1c c0327324 c0327040
>> c0056fe4 c0310aec c0310b3c 00000000 c00595e8 fda0: 0000005a c0318d68
>> 00000000 c0056a00 0000005a c000efdc c0327350 00000001 fdc0: c782fde8
>> c0008508 c021c7c0 60000013 ffffffff c782fe1c c0310b3c c0310b1c fde0:
>> 60000013 c000dd80 c0310b3c c782c000 ffffffff 00000001 60000013
>> c0310aec fe00: c1392300 0000005a c0310b3c c0310b1c 60000013 c0327040
>> f6010000 c782fe30 fe20: c021c7bc c021c7c0 60000013 ffffffff c01a4918
>> c0057d48 c138bc90 c008c344 fe40: c01a4918 00000000 00000000 c1393010
>> 0000005a c1392300 c0310aec c00581e4 fe60: c138bcd0 00000000 c01a4918
>> 0000005a c1393010 c02ede10 c0308998 c0059e00 fe80: c784fe60 c1393010
>> c784fe60 0000005a c1393010 c0308990 c03229e8 c0308998 fea0: c02f1818
>> c0218c7c 00000000 c784fe60 c1393010 00000000 c03089cc 60000013 fec0:
>> c7851940 00000000 c03229e8 c0308998 c0308998 c03229e8 c03229e8
>> c0357938 fee0: c02ede10 c02f1818 c0327040 c016ba7c c0308998 c016a6f0
>> c0308998 c03089cc ff00: c03229e8 c016a880 c782e000 c016a90c 00000000
>> c782ff20 c03229e8 c0168fe8 ff20: c7803878 c7823ac0 c031e0c8 c02875cc
>> c138c480 c03229e8 c031e0c8 c01697b8 ff40: c02875cc c03229e8 00000007
>> 00000000 c03229e8 00000007 c0327040 c016aebc ff60: 00000000 c02f180c
>> 00000007 c0327040 c782e000 c00085f0 c030c378 00000000 ff80: 00000053
>> 00000000 c0459cf9 c00377dc 00000006 00000006 c02c1380 c02a0130 ffa0:
>> c030c378 c02f6380 c02f180c 00000007 c0327040 00000053 c02d81b0
>> c02f1818 ffc0: 00000000 c02d830c 00000006 00000006 c02d81b0 00000000
>> 00000000 c02d821c ffe0: c000f0ac 00000013 00000000 00000000 00000000
>> c000f0ac 0002fbf7 00007fff [<c01a3408>]
>> (s3c_hsotg_handle_outdone+0x40/0xdc) from [<c01a4eb8>]
>> (s3c_hsotg_irq+0x5a0/0x5fc) [<c01a4eb8>] (s3c_hsotg_irq+0x5a0/0x5fc)
>> from [<c0056e44>] (handle_irq_event_percpu+0x50/0x1b4) [<c0056e44>]
>> (handle_irq_event_percpu+0x50/0x1b4) from [<c0056fe4>]
>> (handle_irq_event+0x3c/0x5c) [<c0056fe4>]
>> (handle_irq_event+0x3c/0x5c) from [<c00595e8>]
>> (handle_level_irq+0x8c/0x118) [<c00595e8>]
>> (handle_level_irq+0x8c/0x118) from [<c0056a00>]
>> (generic_handle_irq+0x38/0x44) [<c0056a00>]
>> (generic_handle_irq+0x38/0x44) from [<c000efdc>]
>> (handle_IRQ+0x30/0x84) [<c000efdc>] (handle_IRQ+0x30/0x84) from
>> [<c0008508>] (vic_handle_irq+0x68/0xa8) [<c0008508>]
>> (vic_handle_irq+0x68/0xa8) from [<c000dd80>] (__irq_svc+0x40/0x54)
>> Exception stack(0xc782fde8 to 0xc782fe30) fde0:
>> c0310b3c c782c000 ffffffff 00000001 60000013 c0310aec fe00: c1392300
>> 0000005a c0310b3c c0310b1c 60000013 c0327040 f6010000 c782fe30 fe20:
>> c021c7bc c021c7c0 60000013 ffffffff [<c000dd80>]
>> (__irq_svc+0x40/0x54) from [<c021c7c0>]
>> (_raw_spin_unlock_irqrestore+0x10/0x14) [<c021c7c0>]
>> (_raw_spin_unlock_irqrestore+0x10/0x14) from [<c0057d48>]
>> (__setup_irq+0x184/0x408) [<c0057d48>] (__setup_irq+0x184/0x408) from
>> [<c00581e4>] (request_threaded_irq+0xc4/0x12c) [<c00581e4>]
>> (request_threaded_irq+0xc4/0x12c) from [<c0059e00>]
>> (devm_request_threaded_irq+0x58/0x8c) [<c0059e00>]
>> (devm_request_threaded_irq+0x58/0x8c) from [<c0218c7c>]
>> (s3c_hsotg_probe+0xdc/0x5c0) [<c0218c7c>]
>> (s3c_hsotg_probe+0xdc/0x5c0) from [<c016ba7c>]
>> (platform_drv_probe+0x18/0x1c) [<c016ba7c>]
>> (platform_drv_probe+0x18/0x1c) from [<c016a6f0>]
>> (driver_probe_device+0x78/0x208) [<c016a6f0>]
>> (driver_probe_device+0x78/0x208) from [<c016a90c>]
>> (__driver_attach+0x8c/0x90) [<c016a90c>] (__driver_attach+0x8c/0x90)
>> from [<c0168fe8>] (bus_for_each_dev+0x60/0x8c) [<c0168fe8>]
>> (bus_for_each_dev+0x60/0x8c) from [<c01697b8>]
>> (bus_add_driver+0xac/0x248) [<c01697b8>] (bus_add_driver+0xac/0x248)
>> from [<c016aebc>] (driver_register+0x58/0x14c)
>> [<c016aebc>] (driver_register+0x58/0x14c) from [<c00085f0>]
>> (do_one_initcall+0x34/0x17c)
>> [<c00085f0>] (do_one_initcall+0x34/0x17c) from [<c02d830c>]
>> (kernel_init+0xf0/0x1bc)
>> [<c02d830c>] (kernel_init+0xf0/0x1bc) from [<c000f0ac>]
>> (kernel_thread_exit+0x0/0x8)
>> Code: e0433105 e0653003 e1a03183 e0826003 (e5964030)
>> ---[ end trace 91f15b573a676870 ]---
>> Kernel panic - not syncing: Fatal exception in interrupt
>>
>
>
>
> --
> Best regards,
>
> Lukasz Majewski
>
> Samsung Poland R&D Center | Linux Platform Group
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5
  2012-08-08  5:02         ` Peiyong Feng
@ 2012-08-08  6:13           ` Lukasz Majewski
  2012-08-08  6:59             ` Peiyong Feng
  0 siblings, 1 reply; 9+ messages in thread
From: Lukasz Majewski @ 2012-08-08  6:13 UTC (permalink / raw)
  To: Peiyong Feng; +Cc: balbi, linux-usb, linux-kernel

Dear Peiyong Feng,

> > Please enable the debug at s3c-hsotg.c driver and then paste the
> > dmesg/debug output.  
> I have defined DEGUG in s3c-hsotg.c

Thank you for 2.6.36 log.
I'd also need the log from 3.6-rc1 kernel with DEBUG enabled.

-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5
  2012-08-08  6:13           ` Lukasz Majewski
@ 2012-08-08  6:59             ` Peiyong Feng
  0 siblings, 0 replies; 9+ messages in thread
From: Peiyong Feng @ 2012-08-08  6:59 UTC (permalink / raw)
  To: Lukasz Majewski; +Cc: balbi, linux-usb, linux-kernel

2012/8/8 Lukasz Majewski <l.majewski@samsung.com>:
> Dear Peiyong Feng,
>
>> > Please enable the debug at s3c-hsotg.c driver and then paste the
>> > dmesg/debug output.
>> I have defined DEGUG in s3c-hsotg.c
>
> Thank you for 2.6.36 log.
> I'd also need the log from 3.6-rc1 kernel with DEBUG enabled.
I have made a define like:
#define DEBUG
in s3c-hsotg.c of 3.6-rc1 kernel and the patch:
======================================
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index b13e0bb..b35d275 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -36,6 +36,7 @@

 #include <mach/map.h>

+#define DEBUG
 #include "s3c-hsotg.h"

 #define DMA_ADDR_INVALID (~((dma_addr_t)0))
=-========================================

And the output is just the same as I have posted.

If that is not the way you want, please let me know.


>
> --
> Best regards,
>
> Lukasz Majewski
>
> Samsung Poland R&D Center | Linux Platform Group

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-08-08  6:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-06 10:12 [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5 Peiyong Feng
2012-08-06 10:12 ` Felipe Balbi
2012-08-06 13:14   ` Lukasz Majewski
2012-08-07  3:04     ` Peiyong Feng
2012-08-07  9:34       ` Lukasz Majewski
2012-08-08  5:02         ` Peiyong Feng
2012-08-08  6:13           ` Lukasz Majewski
2012-08-08  6:59             ` Peiyong Feng
2012-08-07 16:34     ` Mark Brown

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.