From patchwork Mon Sep 20 15:10:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 195172 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8KFAwKE003677 for ; Mon, 20 Sep 2010 15:10:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752473Ab0ITPK5 (ORCPT ); Mon, 20 Sep 2010 11:10:57 -0400 Received: from cantor.suse.de ([195.135.220.2]:47810 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752008Ab0ITPK4 (ORCPT ); Mon, 20 Sep 2010 11:10:56 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id B2AC59417A; Mon, 20 Sep 2010 17:10:55 +0200 (CEST) Date: Mon, 20 Sep 2010 17:10:52 +0200 (CEST) From: Jiri Kosina To: Mat Cc: Guillaume Chazarain , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Alan Stern , Oliver Neukum , Alan Ott , linux-usb@vger.kernel.org, linux-input@vger.kernel.org, Andreas Bombe , Alex Riesen , Phil Turmel Subject: Re: [BUG, Regression, bisected] USB mouse causes bug on 1st insert, ignored on 2nd insert, lsusb stuck at usbdev_open In-Reply-To: Message-ID: References: <4C96B9DB.8030403@turmel.org> <4C975F79.9060609@turmel.org> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 20 Sep 2010 15:10:58 +0000 (UTC) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 3f72924..3159a63 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1155,6 +1155,8 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) unsigned int i; int len; + printk("HID debug: hid_connect() -- hid: %p\n", hdev); + if (hdev->quirks & HID_QUIRK_HIDDEV_FORCE) connect_mask |= (HID_CONNECT_HIDDEV_FORCE | HID_CONNECT_HIDDEV); if (hdev->quirks & HID_QUIRK_HIDINPUT_FORCE) @@ -1169,8 +1171,11 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) hdev->claimed |= HID_CLAIMED_INPUT; if ((connect_mask & HID_CONNECT_HIDDEV) && hdev->hiddev_connect && !hdev->hiddev_connect(hdev, - connect_mask & HID_CONNECT_HIDDEV_FORCE)) + connect_mask & HID_CONNECT_HIDDEV_FORCE)) { hdev->claimed |= HID_CLAIMED_HIDDEV; + printk("HID debug: hid_connect() -- after hiddev_connect(), hid: %p, hiddev: %p\n", + hdev, hdev->hiddev); + } if ((connect_mask & HID_CONNECT_HIDRAW) && !hidraw_connect(hdev)) hdev->claimed |= HID_CLAIMED_HIDRAW; diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 599041a..d2491a1 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1148,6 +1148,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * if (IS_ERR(hid)) return PTR_ERR(hid); + printk("HID debug: usbhid_probe() -- set intfdata(%p, %p)\n", intf, hid); usb_set_intfdata(intf, hid); hid->ll_driver = &usb_hid_driver; hid->hid_output_raw_report = usbhid_output_raw_report; diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 681e620..9aab39a 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -282,6 +282,8 @@ static int hiddev_open(struct inode *inode, struct file *file) list->hiddev = hiddev; file->private_data = list; + printk("HID debug: hiddev_open(): hid: %p, hiddev: %p, intf: %p\n", + hid, hiddev, intf); /* * no need for locking because the USB major number * is shared which usbcore guards against disconnect @@ -892,6 +894,8 @@ int hiddev_connect(struct hid_device *hid, unsigned int force) hid->hiddev = hiddev; hiddev->hid = hid; hiddev->exist = 1; + printk("HID debug: hiddev_connect() -- hid: %p, hiddev: %p, intf: %p\n", + hid, hiddev, usbhid->intf); retval = usb_register_dev(usbhid->intf, &hiddev_class); if (retval) { err_hid("Not able to get a minor for this device."); @@ -912,6 +916,8 @@ void hiddev_disconnect(struct hid_device *hid) struct hiddev *hiddev = hid->hiddev; struct usbhid_device *usbhid = hid->driver_data; + printk("HID debug: hiddev_disconnect() -- hid: %p, usbhid: %p, hiddev: %p\n", + hid, usbhid, hiddev); mutex_lock(&hiddev->existancelock); hiddev->exist = 0; mutex_unlock(&hiddev->existancelock);