aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/driver.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-09-19 10:08:43 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 11:58:57 -0700
commit592fbbe4bc339399d363dd55f0391e0623400706 (patch)
tree4b21f83f393e7fefb5c73e0e460052b67058f178 /drivers/usb/core/driver.c
parentusbcore: remove usb_suspend_root_hub (diff)
downloadlinux-dev-592fbbe4bc339399d363dd55f0391e0623400706.tar.xz
linux-dev-592fbbe4bc339399d363dd55f0391e0623400706.zip
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: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to '')
-rw-r--r--drivers/usb/core/driver.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 2b2000ac05ab..0d063c8ca4b4 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1071,10 +1071,15 @@ int usb_resume_both(struct usb_device *udev)
PM_EVENT_ON)
status = -EHOSTUNREACH;
}
- if (status == 0 && udev->state == USB_STATE_SUSPENDED)
+ if (status == 0)
status = resume_device(udev);
if (parent)
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 */