From patchwork Thu Jun 13 09:10:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjunath.goudar@linaro.org X-Patchwork-Id: 17874 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0D57325BE0 for ; Thu, 13 Jun 2013 09:11:53 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id m1sf11091758ves.7 for ; Thu, 13 Jun 2013 02:11:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=U6p7ZPYI3i/gmAVzM33xNksWiSzn+LIDlPFBcOV9WNE=; b=Ww6BzT7GtJSVpTajHMQ7MvYRi+ENLSKyToDonxDP3Gy6Kh4+0VPBphiNUKdScl5q0x GZPnPtgeEvtmnNUuL0ivmqv3OqUAD2IOjUbh6faAJYatH+E90bPIhG4mtGYrFQB2xP6K Lxzqis5yPaJ71r4tltAVw7O8ytfjob/Jmd57oFLulHWLJPmG1iZztfqmi+2AxENAPLda fgCo9d4Bbr9QWlL9t2BUHVRtLSgSStMUH96PT/l/2OEExXdxBJ8SllAc0laaKEebjygO S69U9Lppy2sS3fu2ibkr1roBINUxkz4ZJaoGikXZ76RUTOedEnFKBaOr7ceUcghpKpg5 zZiQ== X-Received: by 10.236.15.73 with SMTP id e49mr1490757yhe.15.1371114712688; Thu, 13 Jun 2013 02:11:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.1 with SMTP id g1ls3819617qeg.64.gmail; Thu, 13 Jun 2013 02:11:52 -0700 (PDT) X-Received: by 10.58.238.167 with SMTP id vl7mr11238768vec.19.1371114712559; Thu, 13 Jun 2013 02:11:52 -0700 (PDT) Received: from mail-vb0-x22f.google.com (mail-vb0-x22f.google.com [2607:f8b0:400c:c02::22f]) by mx.google.com with ESMTPS id l8si2965681vcf.56.2013.06.13.02.11.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:52 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22f; Received: by mail-vb0-f47.google.com with SMTP id x14so6715309vbb.20 for ; Thu, 13 Jun 2013 02:11:52 -0700 (PDT) X-Received: by 10.52.170.148 with SMTP id am20mr9522579vdc.75.1371114712432; Thu, 13 Jun 2013 02:11:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.191.99 with SMTP id gx3csp13568vec; Thu, 13 Jun 2013 02:11:51 -0700 (PDT) X-Received: by 10.68.106.196 with SMTP id gw4mr23637944pbb.126.1371114711485; Thu, 13 Jun 2013 02:11:51 -0700 (PDT) Received: from mail-pb0-x234.google.com (mail-pb0-x234.google.com [2607:f8b0:400e:c01::234]) by mx.google.com with ESMTPS id pj4si13459828pac.240.2013.06.13.02.11.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:51 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::234 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::234; Received: by mail-pb0-f52.google.com with SMTP id xa12so10143400pbc.11 for ; Thu, 13 Jun 2013 02:11:51 -0700 (PDT) X-Received: by 10.66.145.34 with SMTP id sr2mr1881225pab.94.1371114711093; Thu, 13 Jun 2013 02:11:51 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id p2sm28451974pag.22.2013.06.13.02.11.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:50 -0700 (PDT) From: Manjunath Goudar To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, stern@rowland.harvard.edu, arnd@linaro.org, manjunath.goudar@linaro.org, linaro-dev@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH 07/10] USB: OHCI: Properly handle ohci-platform suspend Date: Thu, 13 Jun 2013 14:40:58 +0530 Message-Id: <1371114661-2207-8-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371114661-2207-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371114661-2207-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQk8wFCHiLMZEensnA421FvGX2/dOWieo/Fv4cQmq/mqi2q/pQetalMQgILzdoIchipVSnlB X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Suspend scenario in case of ohci-platform glue was not properly handled as it was not suspending generic part of ohci controller.Calling explicitly the ohci_suspend() routine in ohci_platform_suspend() will ensure proper handling of suspend scenario. V2: -Incase ohci_suspend() fails, return right away without executing further. Signed-off-by: Manjunath Goudar Cc: Arnd Bergmann Cc: Alan Stern Cc: Greg KH Cc: linux-usb@vger.kernel.org --- drivers/usb/host/ohci-platform.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index bc30475..f91201b 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -139,14 +139,25 @@ static int ohci_platform_remove(struct platform_device *dev) static int ohci_platform_suspend(struct device *dev) { + struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ohci_pdata *pdata = dev->platform_data; struct platform_device *pdev = container_of(dev, struct platform_device, dev); + bool do_wakeup = device_may_wakeup(dev); + int ret; + + ret = ohci_suspend(hcd, do_wakeup); + if (ret == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) { + ohci_resume(hcd, false); + ret = -EBUSY; + } + if (ret) + return ret; if (pdata->power_suspend) pdata->power_suspend(pdev); - return 0; + return ret; } static int ohci_platform_resume(struct device *dev)