]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
HID: autosuspend -- fix lockup of hid on reset
authorOliver Neukum <oliver@neukum.org>
Sun, 22 Mar 2009 17:01:49 +0000 (18:01 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 25 Mar 2009 16:57:58 +0000 (17:57 +0100)
This fixes a use of flush_scheduled_work() in USB HID's reset logic that can
deadlock.

Tested-by: Valdis Kletniks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/usbhid/hid-core.c

index 054f0c521e6fecf8435c70e39a6e434cd54671eb..a1ef41f067ceca35d9d7f2f240cb009f5da6d042 100644 (file)
@@ -1207,7 +1207,6 @@ static void hid_cease_io(struct usbhid_device *usbhid)
        usb_kill_urb(usbhid->urbin);
        usb_kill_urb(usbhid->urbctrl);
        usb_kill_urb(usbhid->urbout);
-       flush_scheduled_work();
 }
 
 /* Treat USB reset pretty much the same as suspend/resume */
@@ -1219,6 +1218,7 @@ static int hid_pre_reset(struct usb_interface *intf)
        spin_lock_irq(&usbhid->lock);
        set_bit(HID_RESET_PENDING, &usbhid->iofl);
        spin_unlock_irq(&usbhid->lock);
+       cancel_work_sync(&usbhid->restart_work);
        hid_cease_io(usbhid);
 
        return 0;