Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d461095ef6967324bc5da5d65d23ad27fc604f9 Commit: 4d461095ef6967324bc5da5d65d23ad27fc604f9 Parent: 784a6e1cc406b7ef48476a1f38b83fc551f5616f Author: Alan Stern <[EMAIL PROTECTED]> AuthorDate: Fri May 4 11:51:25 2007 -0400 Committer: Greg Kroah-Hartman <[EMAIL PROTECTED]> CommitDate: Thu Jul 12 16:29:46 2007 -0700
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 <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/core/driver.c | 9 ++++++++- 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 38c3dd2..63d4794 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) { diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c index 9bbcb20..e7ec9b6 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) static int generic_suspend(struct usb_device *udev, pm_message_t msg) { - /* USB devices enter SUSPEND state through their hubs, but can be - * marked for FREEZE as soon as their children are already idled. - * But those semantics are useless, so we equate the two (sigh). - */ return usb_port_suspend(udev); } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html