Commit 54515fe5 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: unify reset_resume and normal resume

This patch (as919) unifies the code paths used for normal resume and
for reset-resume.  Earlier I had failed to note a section in the USB
spec which requires the host to resume a suspended port before
resetting it if the attached device is enabled for remote wakeup.
Since the port has to be resumed anyway, we might as well reuse the
existing code.

The main changes are:

	usb_reset_suspended_device() is eliminated.

	usb_root_hub_lost_power() is moved down next to the
	hub_reset_resume() routine, to which it is logically
	related.

	finish_port_resume() does a port reset() if the device's
	reset_resume flag is set.

	usb_port_resume() doesn't check whether the port is initially
	enabled if this is a USB-Persist sort of resume.

	Code to perform the port reset is added to the resume pathway
	for the non-CONFIG_USB_SUSPEND case.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f07600cf
...@@ -219,8 +219,6 @@ static int generic_resume(struct usb_device *udev) ...@@ -219,8 +219,6 @@ static int generic_resume(struct usb_device *udev)
*/ */
if (!udev->parent) if (!udev->parent)
rc = hcd_bus_resume(udev); rc = hcd_bus_resume(udev);
else if (udev->reset_resume)
rc = usb_reset_suspended_device(udev);
else else
rc = usb_port_resume(udev); rc = usb_port_resume(udev);
return rc; return rc;
......
This diff is collapsed.
...@@ -36,7 +36,6 @@ extern void usb_host_cleanup(void); ...@@ -36,7 +36,6 @@ extern void usb_host_cleanup(void);
extern void usb_autosuspend_work(struct work_struct *work); extern void usb_autosuspend_work(struct work_struct *work);
extern int usb_port_suspend(struct usb_device *dev); extern int usb_port_suspend(struct usb_device *dev);
extern int usb_port_resume(struct usb_device *dev); extern int usb_port_resume(struct usb_device *dev);
extern int usb_reset_suspended_device(struct usb_device *udev);
extern int usb_external_suspend_device(struct usb_device *udev, extern int usb_external_suspend_device(struct usb_device *udev,
pm_message_t msg); pm_message_t msg);
extern int usb_external_resume_device(struct usb_device *udev); extern int usb_external_resume_device(struct usb_device *udev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment