From patchwork Wed Apr 9 04:00:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 3952421 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 73C1F9F4F4 for ; Wed, 9 Apr 2014 04:02:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F3242052F for ; Wed, 9 Apr 2014 04:02:15 +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 9C65C20600 for ; Wed, 9 Apr 2014 04:02:14 +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 1WXjhx-0003lR-Ad; Wed, 09 Apr 2014 04:01:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXjhg-0007pm-5c; Wed, 09 Apr 2014 04:01:43 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXjhT-0007oO-P4 for linux-arm-kernel@lists.infradead.org; Wed, 09 Apr 2014 04:01:30 +0000 Received: by mail-pb0-f49.google.com with SMTP id jt11so1931469pbb.8 for ; Tue, 08 Apr 2014 21:00:58 -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; bh=xWShO/X/BlOVFsDwyFlh0MZWKKMzbQC4EKQsHX7wqME=; b=rQGvvop3mymMdcd4RTY+zSwtLYN3Ss2MIh6iG3qkd0Q/JdZSXLxVCXE0i3RMf2vUGb +y4dBFe7Zs7Gg9sPjY8Q3/VkvorTTByyuyoNfWFquC1yFFIB+eBtRlEVFp2iPKbKuqup bb10+CCtQYdM4Q9doK21I3uS2V34LziV5vqGPl6FjKryO9FWOiBNwug/FQTwaoExU1Nx YTVTliZ/WmZP0A0rUpbtEvmEYWl/VJ4wLlx1DESTfqII7brL0ShBo8Q3iDjn+hqvNa1s rMN7DMvCd+XqIv/n9bE8a29HiEsit2mzxu4uH9v5gBBayd6b3Hn5nJT7Ecyq1x/04T2V SX9Q== X-Received: by 10.68.244.229 with SMTP id xj5mr9178318pbc.108.1397016057817; Tue, 08 Apr 2014 21:00:57 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id wp3sm8062329pbc.67.2014.04.08.21.00.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 21:00:57 -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 1/2] usb: ehci-exynos: Return immediately from suspend if ehci_suspend fails Date: Wed, 9 Apr 2014 09:30:41 +0530 Message-Id: <1397016042-4451-1-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140409_000123_930778_D18E6652 X-CRM114-Status: GOOD ( 10.26 ) X-Spam-Score: -2.4 (--) Cc: Jingoo Han , gregkh@linuxfoundation.org, kgene.kim@samsung.com, Alan Stern 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.4 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: Jingoo Han Acked-by: Jingoo Han --- Based on 'usb-next' branch of Greg's usb tree. drivers/usb/host/ehci-exynos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index d1d8c47..a4550eb 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -212,6 +212,8 @@ static int exynos_ehci_suspend(struct device *dev) int rc; rc = ehci_suspend(hcd, do_wakeup); + if (rc) + return rc; if (exynos_ehci->otg) exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self); @@ -221,7 +223,7 @@ static int exynos_ehci_suspend(struct device *dev) clk_disable_unprepare(exynos_ehci->clk); - return rc; + return 0; } static int exynos_ehci_resume(struct device *dev)