From patchwork Mon Sep 20 13:25:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 194712 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 o8KDPvfm022585 for ; Mon, 20 Sep 2010 13:25:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755931Ab0ITNZ5 (ORCPT ); Mon, 20 Sep 2010 09:25:57 -0400 Received: from cantor.suse.de ([195.135.220.2]:44096 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753111Ab0ITNZ4 (ORCPT ); Mon, 20 Sep 2010 09:25: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 3F3DA93A00; Mon, 20 Sep 2010 15:25:55 +0200 (CEST) Date: Mon, 20 Sep 2010 15:25:54 +0200 (CEST) From: Jiri Kosina To: Phil Turmel 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, Mat , Andreas Bombe , Alex Riesen Subject: Re: [BUG, Regression, bisected] USB mouse causes bug on 1st insert, ignored on 2nd insert, lsusb stuck at usbdev_open In-Reply-To: <4C975F79.9060609@turmel.org> 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 13:25:57 +0000 (UTC) diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 681e620..3a5f097 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -270,17 +270,26 @@ static int hiddev_open(struct inode *inode, struct file *file) struct hiddev *hiddev; int res; + printk("A\n"); intf = usbhid_find_interface(iminor(inode)); + printk("B\n"); if (!intf) return -ENODEV; + printk("C\n"); hid = usb_get_intfdata(intf); + printk("D\n"); hiddev = hid->hiddev; + printk("E\n"); if (!(list = kzalloc(sizeof(struct hiddev_list), GFP_KERNEL))) return -ENOMEM; + printk("F\n"); mutex_init(&list->thread_lock); + printk("G\n"); list->hiddev = hiddev; + printk("H\n"); file->private_data = list; + printk("I\n"); /* * no need for locking because the USB major number @@ -298,11 +307,14 @@ static int hiddev_open(struct inode *inode, struct file *file) res = -ENODEV; goto bail; } + printk("J\n"); spin_lock_irq(&list->hiddev->list_lock); list_add_tail(&list->node, &hiddev->list); spin_unlock_irq(&list->hiddev->list_lock); + printk("K\n"); + if (!list->hiddev->open++) if (list->hiddev->exist) { struct hid_device *hid = hiddev->hid; @@ -313,10 +325,13 @@ static int hiddev_open(struct inode *inode, struct file *file) } usbhid_open(hid); } + printk("L\n"); return 0; bail: + printk("M\n"); file->private_data = NULL; kfree(list); + printk("N\n"); return res; }