aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-09-19 10:07:58 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 11:59:00 -0700
commit353a4098c61272b33a02ec5802fb3859fec91a0e (patch)
treebe2480d2fb0184b6d31954f01ccd074296bde252 /drivers/usb/core/hub.c
parentUSB: ohci_usb can oops on shutdown (diff)
downloadlinux-dev-353a4098c61272b33a02ec5802fb3859fec91a0e.tar.xz
linux-dev-353a4098c61272b33a02ec5802fb3859fec91a0e.zip
USB: force root hub resume after power loss
This patch(as785) forces the PM core to resume a root hub after a power loss during system sleep. If the root hub had been suspended before the system sleep then normally the PM core would not resume it afterward. Without this resume, various sorts of wakeup events (like port change events) can get lost. 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/hub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index c74baad19b16..00441cde4588 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1053,6 +1053,12 @@ void usb_root_hub_lost_power(struct usb_device *rhdev)
unsigned long flags;
dev_warn(&rhdev->dev, "root hub lost power or was reset\n");
+
+ /* Make sure no potential wakeup events get lost,
+ * by forcing the root hub to be resumed.
+ */
+ rhdev->dev.power.prev_state.event = PM_EVENT_ON;
+
spin_lock_irqsave(&device_state_lock, flags);
hub = hdev_to_hub(rhdev);
for (port1 = 1; port1 <= rhdev->maxchild; ++port1) {