]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/core/driver.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git...
[~andy/linux] / drivers / usb / core / driver.c
index 2de2803f653349b457f12a00f436f4c1dc39fbe7..45887a0ff873cee3440869fe83d19ab130b0cd7d 100644 (file)
@@ -1668,6 +1668,11 @@ int usb_runtime_suspend(struct device *dev)
                return -EAGAIN;
 
        status = usb_suspend_both(udev, PMSG_AUTO_SUSPEND);
+
+       /* Allow a retry if autosuspend failed temporarily */
+       if (status == -EAGAIN || status == -EBUSY)
+               usb_mark_last_busy(udev);
+
        /* The PM core reacts badly unless the return code is 0,
         * -EAGAIN, or -EBUSY, so always return -EBUSY on an error.
         */