===================================================================
@@ -1187,6 +1187,10 @@ static int usb_suspend_both(struct usb_d
for (i = n - 1; i >= 0; --i) {
intf = udev->actconfig->interface[i];
status = usb_suspend_interface(udev, intf, msg);
+
+ /* Ignore errors during system sleep transitions */
+ if (!(msg.event & PM_EVENT_AUTO))
+ status = 0;
if (status != 0)
break;
}
@@ -1195,7 +1199,7 @@ static int usb_suspend_both(struct usb_d
status = usb_suspend_device(udev, msg);
/* If the suspend failed, resume interfaces that did get suspended */
- if (status != 0) {
+ if (status != 0 && (msg.event & PM_EVENT_AUTO)) {
msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME);
while (++i < n) {
intf = udev->actconfig->interface[i];
@@ -1303,7 +1307,9 @@ int usb_suspend(struct device *dev, pm_m
do_unbind_rebind(udev, DO_UNBIND);
choose_wakeup(udev, msg);
- return usb_suspend_both(udev, msg);
+ usb_suspend_both(udev, msg);
+
+ return 0; /* Allow system to go to sleep regardless of errors */
}
/* The device lock is held by the PM core */