From patchwork Thu Apr 10 10:28:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 3963311 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1A02A9F374 for ; Thu, 10 Apr 2014 16:07:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 534BC20636 for ; Thu, 10 Apr 2014 16:07:10 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12AF92060C for ; Thu, 10 Apr 2014 16:07:09 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYHV5-0003mB-PK; Thu, 10 Apr 2014 16:06:51 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYHUz-0003wH-Ab; Thu, 10 Apr 2014 16:06:45 +0000 Received: from mail-pb0-x22d.google.com ([2607:f8b0:400e:c01::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYHUw-0003vK-0S for linux-arm-kernel@lists.infradead.org; Thu, 10 Apr 2014 16:06:42 +0000 Received: by mail-pb0-f45.google.com with SMTP id uo5so4123319pbc.18 for ; Thu, 10 Apr 2014 09:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=dA66efMxaOxSKUjByF10bngKSd9EJt752sJxprFIXz4=; b=W44v09smJZBxDyhmc9KFr/tpkRks3BsVVpslw0RAUOo5+0vcnDIE2HdLJQ6WrBd/U8 iptdFC2jOXlfgia5uxy3fVX7KfpzojvJMc0cYAmerkRSoTyvoMbeyOExBbEq9Ybp3sAk h0jnP62stV2X24XYIAIECTotUJmSHKxby5JeSRWt4qKmjSTA93T+x8dquhzOYO5dWqKx qzL8lGEKAXmlowOpe8KVyY0kehC2GgIu//LmlNpMAwKJermhC6BxvSn4klpQOBC97645 ZVzFCl1f7WGjAVAUpUPYJlCXjx/obWhSFkuTsIyal+88ySn40LeGQ3n+jMwAJ3Xmsf91 sg0g== X-Received: by 10.66.230.166 with SMTP id sz6mr18632728pac.127.1397125694697; Thu, 10 Apr 2014 03:28:14 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id ph1sm18644652pac.14.2014.04.10.03.28.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 03:28:13 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] usb: ehci-platform: Return immediately from suspend if ehci_suspend fails Date: Thu, 10 Apr 2014 15:58:02 +0530 Message-Id: <1397125682-4955-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1397125682-4955-1-git-send-email-gautam.vivek@samsung.com> References: <1397125682-4955-1-git-send-email-gautam.vivek@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140410_120642_127178_8E4933A9 X-CRM114-Status: GOOD ( 11.92 ) X-Spam-Score: -1.6 (-) Cc: kgene.kim@samsung.com, gregkh@linuxfoundation.org, jg1.han@samsung.com, Hans de Goede , Alan Stern , Hauke Mehrtens X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Patch 'b8efdaf USB: EHCI: add check for wakeup/suspend race' adds a check for possible race between suspend and wakeup interrupt, and thereby it returns -EBUSY as error code if there's a wakeup interrupt. So the platform host controller should not proceed further with its suspend callback, rather should return immediately to avoid powering down the essential things, like phy. Signed-off-by: Vivek Gautam Cc: Alan Stern Cc: Hauke Mehrtens Cc: Hans de Goede Acked-by: Alan Stern --- Changes from v1: -- Removed unnecessary change 'return 0' drivers/usb/host/ehci-platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index b3a0e11..c7dd93a 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -303,6 +303,8 @@ static int ehci_platform_suspend(struct device *dev) int ret; ret = ehci_suspend(hcd, do_wakeup); + if (ret) + return ret; if (pdata->power_suspend) pdata->power_suspend(pdev);