@@ -729,16 +729,16 @@ void usbhid_close(struct hid_device *hid)
* data acquistion due to a resumption we no longer
* care about
*/
- spin_lock_irq(&usbhid->lock);
+ spin_lock_bh(&usbhid->lock);
if (!--hid->open) {
- spin_unlock_irq(&usbhid->lock);
+ spin_unlock_bh(&usbhid->lock);
hid_cancel_delayed_stuff(usbhid);
if (!(hid->quirks & HID_QUIRK_ALWAYS_POLL)) {
usb_kill_urb(usbhid->urbin);
usbhid->intf->needs_remote_wakeup = 0;
}
} else {
- spin_unlock_irq(&usbhid->lock);
+ spin_unlock_bh(&usbhid->lock);
}
mutex_unlock(&hid_open_mut);
}
@@ -1392,6 +1392,8 @@ static void usbhid_disconnect(struct usb_interface *intf)
static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid)
{
+ might_sleep();
+
del_timer_sync(&usbhid->io_retry);
cancel_work_sync(&usbhid->reset_work);
}