Skip to contentSkip to conversation

fix USB HID devices after STD with autosuspend

PATCH Applied Oliver Neukum 2 participants 2 messages Feb 18, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix USB HID devices after STD with autosuspend

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.

Hi,

this is a patch for the linux-next tree and fixes a regression reported for that tree.

Regards
Oliver

--

drivers/hid/usbhid/hid-core.c renamed from drivers/hid/usbhid/hid-core.c.alt +10 -1
@@ -1333,6 +1333,15 @@ static int hid_post_reset(struct usb_int
 	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;
@@ -1362,7 +1371,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,
Applied
#1 lore raw
Quoted 7 lines · Oliver Neukum

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.

Applied, thanks a lot Oliver.

Signature · 2 lines
Jiri Kosina
SUSE Labs