diff mbox

[Bug,29802] New: [REGRESSION 2.6.38-rc1+] bisected to: USB: use the no_callbacks flag for interfaces

Message ID AANLkTikcfYvw0ztFUBwkLK+wqPjNYyVRgUsZ3mJVb5fi@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ming Lei Feb. 24, 2011, 11:09 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index fca6172..d933f77 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1564,9 +1564,18 @@  EXPORT_SYMBOL_GPL(usb_autopm_get_interface);
  */
 int usb_autopm_get_interface_async(struct usb_interface *intf)
 {
-	int	status;
+	int             status = 0;
+	enum rpm_status s;
+
+	/* Don't request a resume unless the interface is already suspending
+	 * or suspended.  Doing so would force a running suspend timer to be
+	 * cancelled.
+	 */
+	pm_runtime_get_noresume(&intf->dev);
+	s = ACCESS_ONCE(intf->dev.power.runtime_status);
+	if (s == RPM_SUSPENDING || s == RPM_SUSPENDED)
+	        status = pm_request_resume(&intf->dev);
 
-	status = pm_runtime_get(&intf->dev);
 	if (status < 0 && status != -EINPROGRESS)
 		pm_runtime_put_noidle(&intf->dev);
 	else