USB: RESET_RESUME needs to block autosuspend when remote wakeup is needed
authorOliver Neukum <oliver@neukum.org>
Mon, 15 Sep 2008 15:29:28 +0000 (17:29 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 17 Oct 2008 21:40:55 +0000 (14:40 -0700)
Reset upon resumption will wipe the input buffer and is therefore
a reason to not suspend if remote wakeup is requested because
the driver needs that data.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/driver.c

index 5a7fa6f..e935be7 100644 (file)
@@ -1070,7 +1070,8 @@ static int autosuspend_check(struct usb_device *udev, int reschedule)
                                struct usb_driver *driver;
 
                                driver = to_usb_driver(intf->dev.driver);
-                               if (!driver->reset_resume)
+                               if (!driver->reset_resume ||
+                                   intf->needs_remote_wakeup)
                                        return -EOPNOTSUPP;
                        }
                }