usbhid: prevent deadlock during timeout
commit06d5f73748c6a78f612880f190b151801aca046c
authorOliver Neukum <oliver@neukum.org>
Mon, 30 Apr 2012 07:13:46 +0000 (30 09:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2012 07:15:44 +0000 (1 15:15 +0800)
tree07d01c00b064392d36810b261e7a127ecf5bf413
parent5b3a8e30b04642379e6f5ca87e050497e439ca2f
usbhid: prevent deadlock during timeout

commit 8815bb09af21316aeb5f8948b24ac62181670db2 upstream.

On some HCDs usb_unlink_urb() can directly call the
completion handler. That limits the spinlocks that can
be taken in the handler to locks not held while calling
usb_unlink_urb()
To prevent a race with resubmission, this patch exposes
usbcore's infrastructure for blocking submission, uses it
and so drops the lock without causing a race in usbhid.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/usbhid/hid-core.c
drivers/usb/core/urb.c
include/linux/usb.h