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: 3961991 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 626D09F336 for ; Thu, 10 Apr 2014 10:28:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86E8320616 for ; Thu, 10 Apr 2014 10:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B18F0204F6 for ; Thu, 10 Apr 2014 10:28:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935452AbaDJK2U (ORCPT ); Thu, 10 Apr 2014 06:28:20 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:37151 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935420AbaDJK2P (ORCPT ); Thu, 10 Apr 2014 06:28:15 -0400 Received: by mail-pb0-f45.google.com with SMTP id uo5so3790244pbc.4 for ; Thu, 10 Apr 2014 03:28:14 -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 Cc: gregkh@linuxfoundation.org, kgene.kim@samsung.com, jg1.han@samsung.com, Alan Stern , Hauke Mehrtens , Hans de Goede 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> 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.4 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 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);