diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-05-04 11:51:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:29:46 -0400 |
commit | 4d461095ef6967324bc5da5d65d23ad27fc604f9 (patch) | |
tree | 7b510d94bd7e1351e997504276ccd6e5973b2127 /drivers/usb | |
parent | 784a6e1cc406b7ef48476a1f38b83fc551f5616f (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')
-rw-r--r-- | drivers/usb/core/driver.c | 9 | ||||
-rw-r--r-- | drivers/usb/core/generic.c | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 38c3dd2a44e0..63d47946e3db 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) | |||
1050 | break; | 1050 | break; |
1051 | } | 1051 | } |
1052 | } | 1052 | } |
1053 | if (status == 0) | 1053 | if (status == 0) { |
1054 | |||
1055 | /* Non-root devices don't need to do anything for FREEZE | ||
1056 | * or PRETHAW. */ | ||
1057 | if (udev->parent && (msg.event == PM_EVENT_FREEZE || | ||
1058 | msg.event == PM_EVENT_PRETHAW)) | ||
1059 | goto done; | ||
1054 | status = usb_suspend_device(udev, msg); | 1060 | status = usb_suspend_device(udev, msg); |
1061 | } | ||
1055 | 1062 | ||
1056 | /* If the suspend failed, resume interfaces that did get suspended */ | 1063 | /* If the suspend failed, resume interfaces that did get suspended */ |
1057 | if (status != 0) { | 1064 | if (status != 0) { |
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c index 9bbcb20e2d94..e7ec9b6b7a93 100644 --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c | |||
@@ -193,10 +193,6 @@ static void generic_disconnect(struct usb_device *udev) | |||
193 | 193 | ||
194 | static int generic_suspend(struct usb_device *udev, pm_message_t msg) | 194 | static int generic_suspend(struct usb_device *udev, pm_message_t msg) |
195 | { | 195 | { |
196 | /* USB devices enter SUSPEND state through their hubs, but can be | ||
197 | * marked for FREEZE as soon as their children are already idled. | ||
198 | * But those semantics are useless, so we equate the two (sigh). | ||
199 | */ | ||
200 | return usb_port_suspend(udev); | 196 | return usb_port_suspend(udev); |
201 | } | 197 | } |
202 | 198 | ||