Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56829
b: refs/heads/master
c: ef7f6c7
h: refs/heads/master
i:
  56827: 61cb510
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed May 23, 2007
1 parent f0272d8 commit 8f5e5af
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fe5354f61cad4c0550285283c83c66c070c198e
refs/heads/master: ef7f6c7084b333c7524dcd297e0578d43733a2a2
18 changes: 14 additions & 4 deletions trunk/drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,10 @@ static int autosuspend_check(struct usb_device *udev)

#else

#define autosuspend_check(udev) 0
static inline int autosuspend_check(struct usb_device *udev)
{
return 0;
}

#endif /* CONFIG_USB_SUSPEND */

Expand Down Expand Up @@ -1041,7 +1044,6 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
if (status < 0)
goto done;
}
cancel_delayed_work(&udev->autosuspend);

/* Suspend all the interfaces and then udev itself */
if (udev->actconfig) {
Expand All @@ -1062,9 +1064,16 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
usb_resume_interface(intf);
}

/* Try another autosuspend when the interfaces aren't busy */
if (udev->auto_pm)
autosuspend_check(udev);

/* If the suspend succeeded, propagate it up the tree */
} else if (parent)
usb_autosuspend_device(parent);
} else {
cancel_delayed_work(&udev->autosuspend);
if (parent)
usb_autosuspend_device(parent);
}

done:
// dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status);
Expand Down Expand Up @@ -1475,6 +1484,7 @@ int usb_external_resume_device(struct usb_device *udev)
usb_pm_lock(udev);
udev->auto_pm = 0;
status = usb_resume_both(udev);
udev->last_busy = jiffies;
usb_pm_unlock(udev);

/* Now that the device is awake, we can start trying to autosuspend
Expand Down

0 comments on commit 8f5e5af

Please sign in to comment.