提交 353a4098 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

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: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 71795c1d
...@@ -1053,6 +1053,12 @@ void usb_root_hub_lost_power(struct usb_device *rhdev) ...@@ -1053,6 +1053,12 @@ void usb_root_hub_lost_power(struct usb_device *rhdev)
unsigned long flags; unsigned long flags;
dev_warn(&rhdev->dev, "root hub lost power or was reset\n"); 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); spin_lock_irqsave(&device_state_lock, flags);
hub = hdev_to_hub(rhdev); hub = hdev_to_hub(rhdev);
for (port1 = 1; port1 <= rhdev->maxchild; ++port1) { for (port1 = 1; port1 <= rhdev->maxchild; ++port1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册