udev->reset_resume);
}
}
+ usb_mark_last_busy(udev);
done:
dev_vdbg(&udev->dev, "%s: status %d\n", __func__, status);
pm_runtime_disable(dev);
pm_runtime_set_active(dev);
pm_runtime_enable(dev);
- usb_mark_last_busy(udev);
do_unbind_rebind(udev, DO_REBIND);
}
}
return -EAGAIN;
status = usb_suspend_both(udev, PMSG_AUTO_SUSPEND);
-
- /* Prevent the parent from suspending immediately after */
- if (status == 0 && udev->parent)
- usb_mark_last_busy(udev->parent);
-
return status;
}
* and all its interfaces.
*/
status = usb_resume_both(udev, PMSG_AUTO_RESUME);
- usb_mark_last_busy(udev);
return status;
}
/* Tell the runtime-PM framework the device is active */
pm_runtime_set_active(&udev->dev);
+ pm_runtime_get_noresume(&udev->dev);
pm_runtime_use_autosuspend(&udev->dev);
pm_runtime_enable(&udev->dev);
+ /* By default, forbid autosuspend for all devices. It will be
+ * allowed for hubs during binding.
+ */
+ usb_disable_autosuspend(udev);
+
err = usb_enumerate_device(udev); /* Read descriptors */
if (err < 0)
goto fail;
}
(void) usb_create_ep_devs(&udev->dev, &udev->ep0, udev);
+ usb_mark_last_busy(udev);
+ pm_runtime_put_sync_autosuspend(&udev->dev);
return err;
fail:
usb_set_device_state(udev, USB_STATE_SUSPENDED);
msleep(10);
}
+ usb_mark_last_busy(hub->hdev);
return status;
}
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 */