Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756257Ab2HFNOp (ORCPT ); Mon, 6 Aug 2012 09:14:45 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:9944 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756172Ab2HFNOn (ORCPT ); Mon, 6 Aug 2012 09:14:43 -0400 X-AuditID: cbfee61b-b7f566d000005c8a-5b-501fc3417706 Date: Mon, 06 Aug 2012 15:14:36 +0200 From: Lukasz Majewski To: balbi@ti.com, Peiyong Feng Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [BUG] Kernel panic when try s3c-hsotg.c with kernel 3.5 Message-id: <20120806151436.4761cd4d@amdc308.digital.local> In-reply-to: <20120806101200.GJ17551@arwen.pp.htv.fi> References: <20120806101200.GJ17551@arwen.pp.htv.fi> Organization: SPRC Poland X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFLMWRmVeSWpSXmKPExsVy+t9jAV3Hw/IBBh8fiFtc3jWHzWLRslZm ByaPz5vkAhijuGxSUnMyy1KL9O0SuDJaPp9mLNhsX3F1+izWBsZfJl2MnBwSAiYSd3auYIWw xSQu3FvP1sXIxSEksIhRYvLJZmYIp51J4sTNG+wgVSwCqhITTlwB62AT0JP4fPcpE4gtImAn Mef6LJYuRg4OZgFriZ/78kHCwgIuEtuWHGMDsXmBwiturQCzOQVMJZZunQRmCwnUStx6cwrM 5heQlGj/94MZ4iBbibm/3rBA9ApK/Jh8D8xmFtCS2LytiRXClpfYvOYt8wRGwVlIymYhKZuF pGwBI/MqRtHUguSC4qT0XCO94sTc4tK8dL3k/NxNjOAQfSa9g3FVg8UhRgEORiUe3lsG8gFC rIllxZW5hxglOJiVRHhrFgKFeFMSK6tSi/Lji0pzUosPMUpzsCiJ85p4f/UXEkhPLEnNTk0t SC2CyTJxcEo1MFo+yBVm91nO8u6qx5WqlEXK2uZLbucyzZ06L3jq8yxTk9ozGu+Xp8TNujmP befS6WpG1b5cRwOC7369evyOWPIp6W9Tt4kZ8Mck62w+3TPJpeIV3xX5wtWO3meZt0mbKjZy 7V927+LajRGBuyekaG/zsd/Hy/lV2tHtmq9kmq7/095nfKX5ckosxRmJhlrMRcWJAKR9lWpN AgAA X-TM-AS-MML: No Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8185 Lines: 180 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 : [] lr : [] 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 [] > > (s3c_hsotg_handle_outdone+0x44/0x158) from [] > > (s3c_hsotg_irq+0x75c/0x804) [] > > (s3c_hsotg_irq+0x75c/0x804) from [] > > (handle_irq_event_percpu+0x50/0x1bc) [] > > (handle_irq_event_percpu+0x50/0x1bc) from [] > > (handle_irq_event+0x3c/0x5c) [] > > (handle_irq_event+0x3c/0x5c) from [] > > (handle_level_irq+0x8c/0x118) [] > > (handle_level_irq+0x8c/0x118) from [] > > (generic_handle_irq+0x38/0x44) [] > > (generic_handle_irq+0x38/0x44) from [] > > (handle_IRQ+0x30/0x84) [] (handle_IRQ+0x30/0x84) from > > [] (vic_handle_irq+0x68/0xa8) [] > > (vic_handle_irq+0x68/0xa8) from [] (__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 [] > > (__irq_svc+0x40/0x60) from [] > > (_raw_spin_unlock_irqrestore+0x10/0x14) [] > > (_raw_spin_unlock_irqrestore+0x10/0x14) from [] > > (__setup_irq+0x178/0x3f8) [] (__setup_irq+0x178/0x3f8) > > from [] (request_threaded_irq+0xc4/0x12c) [] > > (request_threaded_irq+0xc4/0x12c) from [] > > (s3c_hsotg_probe+0x14c/0x700) [] > > (s3c_hsotg_probe+0x14c/0x700) from [] > > (platform_drv_probe+0x18/0x1c) [] > > (platform_drv_probe+0x18/0x1c) from [] > > (driver_probe_device+0x78/0x200) [] > > (driver_probe_device+0x78/0x200) from [] > > (__driver_attach+0x8c/0x90) [] > > (__driver_attach+0x8c/0x90) from [] > > (bus_for_each_dev+0x60/0x8c) [] > > (bus_for_each_dev+0x60/0x8c) from [] > > (bus_add_driver+0xac/0x250) [] > > (bus_add_driver+0xac/0x250) from [] > > (driver_register+0x58/0x130) [] > > (driver_register+0x58/0x130) from [] > > (do_one_initcall+0x34/0x17c) [] > > (do_one_initcall+0x34/0x17c) from [] > > (kernel_init+0xf0/0x1bc) [] (kernel_init+0xf0/0x1bc) from > > [] (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 > > 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: > > ... > > (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 -- 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/