diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2006-07-01 22:11:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 14:58:50 -0400 |
commit | a8e7c5653562f88c0f5f53eac0a890c012655789 (patch) | |
tree | ba227138d408fdc73ccfc62ad8f75d912ece4baf /drivers/usb/core/generic.c | |
parent | 1cc8a25d5b680ff656927ffa9b66fae6b415b1d3 (diff) |
usbcore: resume device resume recursion
This patch (as717b) removes the existing recursion in hub resume code:
Resuming a hub will no longer automatically resume the devices attached
to the hub.
At the same time, it adds one level of recursion: Suspending a USB
device will automatically suspend all the device's interfaces. Failure
at an intermediate stage will cause all the already-suspended interfaces
to be resumed. Attempts to suspend or resume an interface by itself will
do nothing, although they won't return an error. Thus the regular
system-suspend and system-resume procedures should continue to work as
before; only runtime PM will be affected.
The patch also removes the code that tests state of the interfaces
before suspending a device. It's no longer needed, since everything
gets suspended together.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/generic.c')
-rw-r--r-- | drivers/usb/core/generic.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c index 1522195de71..b6dacd7551d 100644 --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c | |||
@@ -184,22 +184,8 @@ static void generic_disconnect(struct usb_device *udev) | |||
184 | 184 | ||
185 | #ifdef CONFIG_PM | 185 | #ifdef CONFIG_PM |
186 | 186 | ||
187 | static int verify_suspended(struct device *dev, void *unused) | ||
188 | { | ||
189 | if (dev->driver == NULL) | ||
190 | return 0; | ||
191 | return (dev->power.power_state.event == PM_EVENT_ON) ? -EBUSY : 0; | ||
192 | } | ||
193 | |||
194 | static int generic_suspend(struct usb_device *udev, pm_message_t msg) | 187 | static int generic_suspend(struct usb_device *udev, pm_message_t msg) |
195 | { | 188 | { |
196 | int status; | ||
197 | |||
198 | /* rule out bogus requests through sysfs */ | ||
199 | status = device_for_each_child(&udev->dev, NULL, verify_suspended); | ||
200 | if (status) | ||
201 | return status; | ||
202 | |||
203 | /* USB devices enter SUSPEND state through their hubs, but can be | 189 | /* USB devices enter SUSPEND state through their hubs, but can be |
204 | * marked for FREEZE as soon as their children are already idled. | 190 | * marked for FREEZE as soon as their children are already idled. |
205 | * But those semantics are useless, so we equate the two (sigh). | 191 | * But those semantics are useless, so we equate the two (sigh). |