Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5ad4f71e2f19a06f738463da1f09ea7fda3a3db2 Commit: 5ad4f71e2f19a06f738463da1f09ea7fda3a3db2 Parent: 7477120e34eef65a530cfb3fea5fe612c89669e5 Author: Alan Stern <[EMAIL PROTECTED]> AuthorDate: Mon Sep 10 11:31:43 2007 -0400 Committer: Greg Kroah-Hartman <[EMAIL PROTECTED]> CommitDate: Fri Oct 12 14:55:26 2007 -0700
USB: move decision to ignore FREEZE events This patch (as987) changes the way FREEZE and PRETHAW suspend events are handled in usbcore. The decision about whether or not to ignore them for non-root devices is pushed down into the USB-device driver, instead of being made in the core code. This is appropriate, since devices exported to a virtualized guest or over a network may indeed need to handle these types of suspend, even though normal devices don't. 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 | 5 +++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 8da4801..ca43a6f 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -1088,15 +1088,8 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) break; } } - 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; + if (status == 0) 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 9148b69..c1cb94e 100644 --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c @@ -206,8 +206,13 @@ static int generic_suspend(struct usb_device *udev, pm_message_t msg) */ if (!udev->parent) rc = hcd_bus_suspend(udev); + + /* Non-root devices don't need to do anything for FREEZE or PRETHAW */ + else if (msg.event == PM_EVENT_FREEZE || msg.event == PM_EVENT_PRETHAW) + rc = 0; else rc = usb_port_suspend(udev); + return rc; } - 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