Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756354Ab0BMNER (ORCPT ); Sat, 13 Feb 2010 08:04:17 -0500 Received: from ppp-157-177.adsl.restena.lu ([158.64.157.177]:32776 "EHLO bonbons.gotdns.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754753Ab0BMNEB (ORCPT ); Sat, 13 Feb 2010 08:04:01 -0500 X-Greylist: delayed 367 seconds by postgrey-1.27 at vger.kernel.org; Sat, 13 Feb 2010 08:04:00 EST Date: Sat, 13 Feb 2010 13:57:20 +0100 From: Bruno =?UTF-8?B?UHLDqW1vbnQ=?= To: Alan Stern Cc: Jiri Kosina , Oliver Neukum , Stephen Rothwell , Marcel Holtmann , H Hartley Sweeten , , , Subject: Re: S2R resume crash in 2.6.33-rc7 - NULL pointer dereference in dev_get_drvdata() for usbhid Message-ID: <20100213135720.603e5f64@neptune.home> In-Reply-To: References: <20100208190649.0ceea556@neptune.home> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9486 Lines: 161 On Mon, 08 February 2010 Alan Stern wrote: > Clearly something is setting usbhid->intf to NULL. But I don't see > any code that would do it. You may have to resort to putting > printk() statements at various strategic places to find out where it > happens. You could start with the beginnings and ends of hid_suspend, > hid_resume, and hid_reset_resume. Maybe also usbhid_disconnect(), > just in case. I did add a few printk()s and WARN_ON()s to get a better idea of why/when usbhid->intf is NULL and it is already since probe time of the second interface anounced by the USB keyboard (hid.debug=1): [ 3.822393] usb 2-2.1: new full speed USB device using uhci_hcd and address 3 [ 4.011388] usb 2-2.1: New USB device found, idVendor=058f, idProduct=9462 [ 4.011502] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 4.011639] usb 2-2.1: Product: Multimedia USB Keyboard [ 4.011733] usb 2-2.1: Manufacturer: Multimedia USB Keyboard [ 4.011826] usb 2-2.1: SerialNumber: Multimedia USB Keyboard [ 4.014514] /usr/src/linux-2.6-git/drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0 [ 4.037712] /usr/src/linux-2.6-git/drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0200 wIndex=0x0000 wLength=1 [ 4.038160] input: Multimedia USB Keyboard Multimedia USB Keyboard as /devices/pci0000:00/0000:00:10.0/usb2/2-2/2-2.1/2-2.1:1.0/input/input4 [ 4.038523] generic-usb 0003:058F:9462.0001: input: USB HID v1.10 Keyboard [Multimedia USB Keyboard Multimedia USB Keyboard] on usb-0000:00:10.0-2.1/input0 [ 4.038901] /usr/src/linux-2.6-git/drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 1 [ 4.066881] /usr/src/linux-2.6-git/drivers/hid/hid-core.c: usage index exceeded [ 4.066894] /usr/src/linux-2.6-git/drivers/hid/hid-core.c: hid_add_usage failed [ 4.066905] /usr/src/linux-2.6-git/drivers/hid/hid-core.c: item 0 2 2 2 parsing failed [ 4.066931] /usr/src/linux-2.6-git/drivers/hid/usbhid/hid-core.c: parsing report descriptor failed >>>> following WARNING comes from WARN_ON() I added to usbhid_parse >>>> to know what the call stack is up to the failing report parsing [ 4.066941] ------------[ cut here ]------------ [ 4.067065] WARNING: at /usr/src/linux-2.6-git/drivers/hid/usbhid/hid-core.c:891 usbhid_parse+0x1db/0x340() [ 4.067226] Hardware name: CX700+W697HG [ 4.067316] Modules linked in: [ 4.067463] Pid: 228, comm: khubd Not tainted 2.6.33-rc7-venus #6 [ 4.067560] Call Trace: [ 4.067662] [] ? printk+0x18/0x1b [ 4.067763] [] ? usbhid_parse+0x1db/0x340 [ 4.067873] [] warn_slowpath_common+0x6c/0xc0 [ 4.067976] [] ? usbhid_parse+0x1db/0x340 [ 4.068080] [] warn_slowpath_null+0x15/0x20 [ 4.068183] [] usbhid_parse+0x1db/0x340 [ 4.068293] [] hid_device_probe+0x155/0x170 [ 4.068396] [] driver_probe_device+0x68/0x160 [ 4.068500] [] ? hid_bus_match+0x88/0x160 [ 4.068605] [] __device_attach+0x41/0x50 [ 4.068707] [] bus_for_each_drv+0x53/0x80 [ 4.068810] [] device_attach+0x6b/0x70 [ 4.068911] [] ? __device_attach+0x0/0x50 [ 4.069014] [] bus_probe_device+0x1f/0x40 [ 4.069117] [] device_add+0x357/0x570 [ 4.069224] [] ? kvasprintf+0x43/0x60 [ 4.069326] [] ? kobject_set_name_vargs+0x62/0x70 [ 4.069432] [] hid_add_device+0x14e/0x1d0 [ 4.069579] [] usbhid_probe+0x202/0x360 [ 4.069685] [] usb_probe_interface+0xaf/0x1c0 [ 4.069791] [] ? driver_sysfs_add+0x52/0x70 [ 4.069895] [] driver_probe_device+0x68/0x160 [ 4.070000] [] ? usb_device_match+0x50/0xb0 [ 4.070135] [] __device_attach+0x41/0x50 [ 4.070234] [] bus_for_each_drv+0x53/0x80 [ 4.070338] [] device_attach+0x6b/0x70 [ 4.070434] [] ? __device_attach+0x0/0x50 [ 4.070530] [] bus_probe_device+0x1f/0x40 [ 4.070626] [] device_add+0x357/0x570 [ 4.070722] [] ? usb_create_ep_devs+0x7c/0xb0 [ 4.070821] [] ? create_intf_ep_devs+0x43/0x70 [ 4.070919] [] usb_set_configuration+0x4a7/0x640 [ 4.071019] [] generic_probe+0x39/0xb0 [ 4.071120] [] ? sysfs_create_link+0x12/0x20 [ 4.071218] [] usb_probe_device+0x1f/0x30 [ 4.071314] [] driver_probe_device+0x68/0x160 [ 4.071412] [] __device_attach+0x41/0x50 [ 4.071508] [] bus_for_each_drv+0x53/0x80 [ 4.071605] [] device_attach+0x6b/0x70 [ 4.071700] [] ? __device_attach+0x0/0x50 [ 4.071797] [] bus_probe_device+0x1f/0x40 [ 4.071892] [] device_add+0x357/0x570 [ 4.071987] [] ? printk+0x18/0x1b [ 4.072081] [] ? show_string+0x4b/0x50 [ 4.072177] [] usb_new_device+0x116/0x180 [ 4.072274] [] hub_thread+0xdbf/0x11d0 [ 4.072372] [] ? dequeue_task_fair+0x27/0x1d0 [ 4.072470] [] ? set_next_entity+0x2e/0x70 [ 4.072567] [] ? finish_task_switch+0x31/0x80 [ 4.072669] [] ? autoremove_wake_function+0x0/0x50 [ 4.072767] [] ? hub_thread+0x0/0x11d0 [ 4.072863] [] kthread+0x6c/0x80 [ 4.072958] [] ? kthread+0x0/0x80 [ 4.073053] [] kernel_thread_helper+0x6/0x10 [ 4.073146] ---[ end trace 74d7f471f706deb5 ]--- [ 4.073256] generic-usb: probe of 0003:058F:9462.0002 failed with error -22 >>>> This is the WARN_ON(usbhid->intf ==NULL) I added just before >>>> return 0 to usbhid_probe() to confirm that intf is already NULL >>>> since the very beginning for this HID device [ 4.073378] ------------[ cut here ]------------ [ 4.073470] WARNING: at /usr/src/linux-2.6-git/drivers/hid/usbhid/hid-core.c:1166 usbhid_probe+0x2d9/0x360() [ 4.073606] Hardware name: CX700+W697HG [ 4.073694] Modules linked in: [ 4.073828] Pid: 228, comm: khubd Tainted: G W 2.6.33-rc7-venus #6 [ 4.073923] Call Trace: [ 4.074013] [] ? printk+0x18/0x1b [ 4.074106] [] ? usbhid_probe+0x2d9/0x360 [ 4.074203] [] warn_slowpath_common+0x6c/0xc0 [ 4.074299] [] ? usbhid_probe+0x2d9/0x360 [ 4.074397] [] warn_slowpath_null+0x15/0x20 [ 4.074493] [] usbhid_probe+0x2d9/0x360 [ 4.074590] [] usb_probe_interface+0xaf/0x1c0 [ 4.074688] [] ? driver_sysfs_add+0x52/0x70 [ 4.074785] [] driver_probe_device+0x68/0x160 [ 4.074881] [] ? usb_device_match+0x50/0xb0 [ 4.074979] [] __device_attach+0x41/0x50 [ 4.075074] [] bus_for_each_drv+0x53/0x80 [ 4.075171] [] device_attach+0x6b/0x70 [ 4.075266] [] ? __device_attach+0x0/0x50 [ 4.075363] [] bus_probe_device+0x1f/0x40 [ 4.075458] [] device_add+0x357/0x570 [ 4.075553] [] ? usb_create_ep_devs+0x7c/0xb0 [ 4.075650] [] ? create_intf_ep_devs+0x43/0x70 [ 4.075749] [] usb_set_configuration+0x4a7/0x640 [ 4.075847] [] generic_probe+0x39/0xb0 [ 4.075944] [] ? sysfs_create_link+0x12/0x20 [ 4.076041] [] usb_probe_device+0x1f/0x30 [ 4.076138] [] driver_probe_device+0x68/0x160 [ 4.076235] [] __device_attach+0x41/0x50 [ 4.076331] [] bus_for_each_drv+0x53/0x80 [ 4.076428] [] device_attach+0x6b/0x70 [ 4.076523] [] ? __device_attach+0x0/0x50 [ 4.076619] [] bus_probe_device+0x1f/0x40 [ 4.076714] [] device_add+0x357/0x570 [ 4.076809] [] ? printk+0x18/0x1b [ 4.076902] [] ? show_string+0x4b/0x50 [ 4.076997] [] usb_new_device+0x116/0x180 [ 4.077094] [] hub_thread+0xdbf/0x11d0 [ 4.077191] [] ? dequeue_task_fair+0x27/0x1d0 [ 4.077288] [] ? set_next_entity+0x2e/0x70 [ 4.077384] [] ? finish_task_switch+0x31/0x80 [ 4.077482] [] ? autoremove_wake_function+0x0/0x50 [ 4.077579] [] ? hub_thread+0x0/0x11d0 [ 4.077674] [] kthread+0x6c/0x80 [ 4.077768] [] ? kthread+0x0/0x80 [ 4.077861] [] kernel_thread_helper+0x6/0x10 [ 4.077954] ---[ end trace 74d7f471f706deb6 ]--- [ 5.401011] udev: starting version 146 [ 5.672965] Linux agpgart interface v0.103 [ 5.776141] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 5.776327] sd 1:0:1:0: Attached scsi generic sg1 type 0 [ 5.968845] VIA Graphics Intergration Chipset framebuffer 2.4 initializing [ 6.145620] agpgart: Detected VIA CX700 chipset [ 6.155095] agpgart-via 0000:00:00.0: AGP aperture is 128M @ 0xd0000000 This lets me guess that hid_add_device() is doing something wrong here when report parsing fails... (as that one is the only one which could be doing the initialization of usbhid which does work for the first interface announced by my keyboard) Bruno -- 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/