aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/core/driver.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-05-04 11:51:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 16:29:46 -0700
commit4d461095ef6967324bc5da5d65d23ad27fc604f9 (patch)
tree7b510d94bd7e1351e997504276ccd6e5973b2127 /drivers/usb/core/driver.c
parent784a6e1cc406b7ef48476a1f38b83fc551f5616f (diff)
USB: Implement PM FREEZE and PRETHAW
This patch (as884) finally implements the time-saving semantics possible with the Power Management FREEZE and PRETHAW events. Their proper handling requires only that devices be quiesced, with interrupts and DMA turned off; non-root USB devices don't actually need to be put in a suspended state. The patch checks and avoids doing the suspend call when possible. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r--drivers/usb/core/driver.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 38c3dd2a44e..63d47946e3d 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1050,8 +1050,15 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
break;
}
}
- if (status == 0)
+ if (status == 0) {
+
+ /* Non-root devices don't need to do anything for FREEZE
+ * or PRETHAW. */
+ if (udev->parent && (msg.event == PM_EVENT_FREEZE ||
+ msg.event == PM_EVENT_PRETHAW))
+ goto done;
status = usb_suspend_device(udev, msg);
+ }
/* If the suspend failed, resume interfaces that did get suspended */
if (status != 0) {