From patchwork Wed Apr 9 04:00:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 3952411 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 09C2D9F38C for ; Wed, 9 Apr 2014 04:02:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4185F205FC for ; Wed, 9 Apr 2014 04:02:14 +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 1EA102052F for ; Wed, 9 Apr 2014 04:02:13 +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 1WXji1-0003mG-RO; Wed, 09 Apr 2014 04:01:57 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXjhz-0007qm-Lh; Wed, 09 Apr 2014 04:01:55 +0000 Received: from mail-pb0-x22f.google.com ([2607:f8b0:400e:c01::22f]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXjhU-0007oP-IS for linux-arm-kernel@lists.infradead.org; Wed, 09 Apr 2014 04:01:30 +0000 Received: by mail-pb0-f47.google.com with SMTP id up15so1950975pbc.34 for ; Tue, 08 Apr 2014 21:01:02 -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=afWoP+NolD8puXdyVm2NkwRy5WGNAhdGtRQAK/oQSNE=; b=aZYtdNzKrQPF9jh4TV0JcR1hH4QKQ6PXiwGXr4s8c77/0zl2os3MN/+d1v7D6PjZ3W sPc3NQp/4jILA190Vv3ZzaQNeXZINp0XEsOfLs0ec53XIiIT4hFrXe6jzRlMD9K9gWga upfS8cbwT0fSmPXB9Z/3zPPNhSMroD/UChMKFNUYyBHl5FODn8ZCiAU4nio57W8k2yA9 1C0wW0+jTgBmzF29a5YYkci/bt9J4Lr5Fw5Dvc10TIaC1Ih37qLDiTyw417iY+WTpeQm WzPXGp9d8kU5K392Ykj0CV2L3XFIJA1OF1+cgwfhboSjcyOV8maxiSeX8kMHort+vrke jKsw== X-Received: by 10.68.134.101 with SMTP id pj5mr9257916pbb.62.1397016062007; Tue, 08 Apr 2014 21:01:02 -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.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 21:01:01 -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 2/2] usb: ehci-platform: Return immediately from suspend if ehci_suspend fails Date: Wed, 9 Apr 2014 09:30:42 +0530 Message-Id: <1397016042-4451-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1397016042-4451-1-git-send-email-gautam.vivek@samsung.com> References: <1397016042-4451-1-git-send-email-gautam.vivek@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140409_000124_714552_F9D76694 X-CRM114-Status: GOOD ( 10.95 ) X-Spam-Score: -1.6 (-) Cc: gregkh@linuxfoundation.org, Hans de Goede , kgene.kim@samsung.com, 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.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: Hauke Mehrtens Cc: Hans de Goede --- Based on 'usb-next' branch of Greg's usb tree. drivers/usb/host/ehci-platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index b3a0e11..60d3d1a 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -303,11 +303,13 @@ 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); - return ret; + return 0; } static int ehci_platform_resume(struct device *dev)