linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch]fix USB HID devices after STD with autosuspend
@ 2009-02-18  8:46 Oliver Neukum
  2009-02-18 10:48 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Neukum @ 2009-02-18  8:46 UTC (permalink / raw)
  To: jikos, linux-input, USB list

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>

Hi,

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

	Regards
		Oliver

--

--- nexttree/drivers/hid/usbhid/hid-core.c.alt	2009-02-17 21:39:45.000000000 +0100
+++ nexttree/drivers/hid/usbhid/hid-core.c	2009-02-17 21:39:57.000000000 +0100
@@ -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,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch]fix USB HID devices after STD with autosuspend
  2009-02-18  8:46 [patch]fix USB HID devices after STD with autosuspend Oliver Neukum
@ 2009-02-18 10:48 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2009-02-18 10:48 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: linux-input, USB list, Laurent Riffard

On Wed, 18 Feb 2009, Oliver Neukum wrote:

> 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>

Applied, thanks a lot Oliver.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-18 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-18  8:46 [patch]fix USB HID devices after STD with autosuspend Oliver Neukum
2009-02-18 10:48 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).