From: Benoit Goby Date: Tue, 14 Dec 2010 04:42:16 +0000 (-0800) Subject: Revert "Revert "usb: core: Temporary workaround for usb auto-suspend issue"" X-Git-Tag: firefly_0821_release~9834^2~256 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=94b5f3cd29b193aecf208a8d4b46d881fc05b5e4;p=firefly-linux-kernel-4.4.55.git Revert "Revert "usb: core: Temporary workaround for usb auto-suspend issue"" This reverts commit b26b14ee87f00806ef24a0d7442d5ef9c7fd8531. --- diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index d7a4401ef019..ffa3e22083c2 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -1324,6 +1324,20 @@ int usb_resume(struct device *dev, pm_message_t msg) * Unbind the interfaces that will need rebinding later. */ } else { + /* If a device aborts suspend, usb_resume may be called on a + * device whose parent has been auto-suspended. Recursively + * resume its parents and change their runtime pm state. + */ + if (udev->parent && msg.event == PM_EVENT_RESUME + && udev->parent->state == USB_STATE_SUSPENDED) { + status = usb_resume(&udev->parent->dev, msg); + if (status) { + dev_err(dev, "%s: failed to resume parent\n", + __func__); + return status; + } + } + status = usb_resume_both(udev, msg); if (status == 0) { pm_runtime_disable(dev);