Skip to content

Commit

Permalink
HID: fix USB HID devices after STD with autosuspend
Browse files Browse the repository at this point in the history
This patch fixes a bug caused by reset_resume not changing the internal
status flags for a device that is resumed via reset_resume. To do so the
reset handlers, which correctly assume that a device is awake, can no longer
do all the work of reset_resume handling.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Laurent Riffard <laurent.riffard@free.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Oliver Neukum authored and Jiri Kosina committed Mar 25, 2009
1 parent 0f6f140 commit 378a0ed
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/hid/usbhid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,15 @@ static int hid_post_reset(struct usb_interface *intf)
return 0;
}

static int hid_reset_resume(struct usb_interface *intf)
{
struct hid_device *hid = usb_get_intfdata(intf);
struct usbhid_device *usbhid = hid->driver_data;

clear_bit(HID_REPORTED_IDLE, &usbhid->iofl);
return hid_post_reset(intf);
}

int usbhid_get_power(struct hid_device *hid)
{
struct usbhid_device *usbhid = hid->driver_data;
Expand Down Expand Up @@ -1359,7 +1368,7 @@ static struct usb_driver hid_driver = {
#ifdef CONFIG_PM
.suspend = hid_suspend,
.resume = hid_resume,
.reset_resume = hid_post_reset,
.reset_resume = hid_reset_resume,
#endif
.pre_reset = hid_pre_reset,
.post_reset = hid_post_reset,
Expand Down

0 comments on commit 378a0ed

Please sign in to comment.