Commit 592fbbe4 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: fix root-hub resume when CONFIG_USB_SUSPEND is not set

This patch (as786) removes a redundant test and fixes a problem
involving repeated system sleeps when CONFIG_USB_SUSPEND is not set.
During the first wakeup, the root hub's dev.power.power_state.event
field doesn't get updated, causing it not to be suspended during the
second sleep transition.

This takes care of the issue raised by Rafael J. Wysocki and Mattia
Dongili.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 02c399ee
...@@ -1071,10 +1071,15 @@ int usb_resume_both(struct usb_device *udev) ...@@ -1071,10 +1071,15 @@ int usb_resume_both(struct usb_device *udev)
PM_EVENT_ON) PM_EVENT_ON)
status = -EHOSTUNREACH; status = -EHOSTUNREACH;
} }
if (status == 0 && udev->state == USB_STATE_SUSPENDED) if (status == 0)
status = resume_device(udev); status = resume_device(udev);
if (parent) if (parent)
mutex_unlock(&parent->pm_mutex); mutex_unlock(&parent->pm_mutex);
} else {
/* Needed only for setting udev->dev.power.power_state.event
* and for possible debugging message. */
status = resume_device(udev);
} }
/* Now the parent won't suspend until we are finished */ /* Now the parent won't suspend until we are finished */
......
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