From patchwork Thu Feb 24 11:09:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 587161 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 p1OBBX5b012455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 24 Feb 2011 11:11:53 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 p1OB9Lws020526; Thu, 24 Feb 2011 03:09:22 -0800 Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.213.175]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p1OB9HNF020504 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Thu, 24 Feb 2011 03:09:18 -0800 Received: by yxn22 with SMTP id 22so221066yxn.6 for ; Thu, 24 Feb 2011 03:09:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.150.220.13 with SMTP id s13mr1769951ybg.44.1298545756811; Thu, 24 Feb 2011 03:09:16 -0800 (PST) Received: by 10.147.34.4 with HTTP; Thu, 24 Feb 2011 03:09:16 -0800 (PST) In-Reply-To: References: Date: Thu, 24 Feb 2011 19:09:16 +0800 Message-ID: From: Ming Lei To: bettiah@gmail.com Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-4.734 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SPF_PASS, 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 Subject: Re: [linux-pm] [Bug 29802] New: [REGRESSION 2.6.38-rc1+] bisected to: USB: use the no_callbacks flag for interfaces 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]); Thu, 24 Feb 2011 11:12:12 +0000 (UTC) diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index fca6172..d933f77 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -1564,9 +1564,18 @@ EXPORT_SYMBOL_GPL(usb_autopm_get_interface); */ int usb_autopm_get_interface_async(struct usb_interface *intf) { - int status; + int status = 0; + enum rpm_status s; + + /* Don't request a resume unless the interface is already suspending + * or suspended. Doing so would force a running suspend timer to be + * cancelled. + */ + pm_runtime_get_noresume(&intf->dev); + s = ACCESS_ONCE(intf->dev.power.runtime_status); + if (s == RPM_SUSPENDING || s == RPM_SUSPENDED) + status = pm_request_resume(&intf->dev); - status = pm_runtime_get(&intf->dev); if (status < 0 && status != -EINPROGRESS) pm_runtime_put_noidle(&intf->dev); else