From patchwork Mon Feb 14 21:12:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Stern X-Patchwork-Id: 558571 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1FAKlIj020262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 15 Feb 2011 10:21:07 GMT Received: from daredevil.linux-foundation.org (localhost [127.0.0.1]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p1FAI5Vr019170; Tue, 15 Feb 2011 02:18:05 -0800 Received: from iolanthe.rowland.org (iolanthe.rowland.org [192.131.102.54]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with SMTP id p1ELJ7gV001105 for ; Mon, 14 Feb 2011 13:19:08 -0800 Received: (qmail 5564 invoked by uid 2102); 14 Feb 2011 16:12:25 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 14 Feb 2011 16:12:25 -0500 Date: Mon, 14 Feb 2011 16:12:25 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Dirk Hohndel In-Reply-To: Message-ID: MIME-Version: 1.0 Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-3.993 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.21 Cc: Linux PM List , Linux USB List , Linus Torvalds Subject: Re: [linux-pm] USB suspend issue with 2.6.38-rc2 -- still there in RC4-g795abaf X-BeenThere: linux-pm@lists.linux-foundation.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux power management List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 15 Feb 2011 10:21:07 +0000 (UTC) Index: usb-2.6/drivers/usb/core/driver.c =================================================================== --- usb-2.6.orig/drivers/usb/core/driver.c +++ usb-2.6/drivers/usb/core/driver.c @@ -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 */