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: 3952401 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F2DFDBFF02 for ; Wed, 9 Apr 2014 04:01:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 59101205FC for ; Wed, 9 Apr 2014 04:01:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A76532052F for ; Wed, 9 Apr 2014 04:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750799AbaDIEBF (ORCPT ); Wed, 9 Apr 2014 00:01:05 -0400 Received: from mail-pb0-f52.google.com ([209.85.160.52]:55347 "EHLO mail-pb0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750796AbaDIEBC (ORCPT ); Wed, 9 Apr 2014 00:01:02 -0400 Received: by mail-pb0-f52.google.com with SMTP id rr13so1936186pbb.25 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 Cc: gregkh@linuxfoundation.org, kgene.kim@samsung.com, Alan Stern , Hauke Mehrtens , Hans de Goede 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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)