USB: improve uses of usb_mark_last_busy

This patch (as1434) cleans up the uses of usb_mark_last_busy() in
usbcore.  The function will be called when a device is resumed and
whenever a usage count is decremented.  A call that was missing from
the hub driver is added: A hub is used whenever one of its ports gets
suspended (this prevents hubs from suspending immediately after their
last child).

In addition, the call to disable autosuspend support for new devices
by default is moved from usb_detect_quirks() (where it doesn't really
belong) into usb_new_device() along with all the other runtime-PM
initializations.  Finally, an extra pm_runtime_get_noresume() is added
to prevent new devices from autosuspending while they are being
registered.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Stern 2010-11-15 15:57:58 -05:00 committed by Greg Kroah-Hartman
parent fcc4a01eb8
commit c08512c761
3 changed files with 10 additions and 16 deletions

View file

@ -117,15 +117,6 @@ void usb_detect_quirks(struct usb_device *udev)
dev_dbg(&udev->dev, "USB quirks for this device: %x\n",
udev->quirks);
#ifdef CONFIG_USB_SUSPEND
/* By default, disable autosuspend for all devices. The hub driver
* will enable it for hubs.
*/
usb_disable_autosuspend(udev);
#endif
/* For the present, all devices default to USB-PERSIST enabled */
#if 0 /* was: #ifdef CONFIG_PM */
/* Hubs are automatically enabled for USB-PERSIST */