From patchwork Mon Jul 22 09:32:39 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: 18472 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1167425E1F for ; Mon, 22 Jul 2013 09:33:21 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id a1sf8286354qcx.10 for ; Mon, 22 Jul 2013 02:33:20 -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=zur/WwbgvTUUoEu3szq63I8H4DET0tYndbgaSvxaFN0=; b=kPndnkcje9MMMEKNbyKRinPW5RbdaSwNMHo29Ygm9CzKsF/TtFyxTKvBEbBGjMs1RC ExAziAGahEyis78guvQxg3xZRQdpVVB7lTGG7/zP2gwIYximDkNt9TSowJ/L799IVAg+ f4G1iMvJvcCpisEUteCDlnSRCo3g4zPc/Cn9IMSGI+eAWp9hyCr51GuVidb0n22Iwulw bukDe/4w5yyWEu6eelGtpVRqq41Z+b7BZYw24aMGqrZRmSniQ1R5GRnw1+UGmngMFEva omu2YgLwAbbsMxd5fCN4Sylgm0/F7lcMr4FQ6CCTl2u4zyykRi8hEnD8S/P/QAKvYAj3 J4NA== X-Received: by 10.236.133.19 with SMTP id p19mr15644709yhi.54.1374485600847; Mon, 22 Jul 2013 02:33:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.50.10 with SMTP id y10ls2512698qen.69.gmail; Mon, 22 Jul 2013 02:33:20 -0700 (PDT) X-Received: by 10.58.202.1 with SMTP id ke1mr8934074vec.85.1374485600733; Mon, 22 Jul 2013 02:33:20 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id w8si6843564vcp.41.2013.07.22.02.33.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id hr11so3471363vcb.23 for ; Mon, 22 Jul 2013 02:33:20 -0700 (PDT) X-Received: by 10.58.251.144 with SMTP id zk16mr8803642vec.37.1374485600646; Mon, 22 Jul 2013 02:33:20 -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.165.8 with SMTP id yu8csp46437veb; Mon, 22 Jul 2013 02:33:20 -0700 (PDT) X-Received: by 10.68.201.163 with SMTP id kb3mr29712490pbc.22.1374485599692; Mon, 22 Jul 2013 02:33:19 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id ie10si18168983pbc.161.2013.07.22.02.33.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq13so1316288pab.25 for ; Mon, 22 Jul 2013 02:33:19 -0700 (PDT) X-Received: by 10.68.106.67 with SMTP id gs3mr29714359pbb.126.1374485599257; Mon, 22 Jul 2013 02:33:19 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.229]) by mx.google.com with ESMTPSA id bb1sm24977759pbc.10.2013.07.22.02.33.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:18 -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-kernel@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Date: Mon, 22 Jul 2013 15:02:39 +0530 Message-Id: <1374485566-3997-5-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQkenZCHUbYmhe+bQo26tybLZ4k18wO8Lihd0CLJfkK3Erww76jlkXJdTikvx3K8J0vLs1vD X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 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-da8xx glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_da8xx_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Acked-by: Alan Stern Cc: Arnd Bergmann Cc: Greg KH Cc: linux-usb@vger.kernel.org V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". -pdev->dev.power.power_state stuff has been removed. V4: -Properly aligned "do_wakeup" and "ret" variable. --- drivers/usb/host/ohci-da8xx.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 6aaa9c9..c649a35 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -406,19 +406,26 @@ static int ohci_hcd_da8xx_drv_remove(struct platform_device *dev) } #ifdef CONFIG_PM -static int ohci_da8xx_suspend(struct platform_device *dev, pm_message_t message) +static int ohci_da8xx_suspend(struct platform_device *pdev, + pm_message_t message) { - struct usb_hcd *hcd = platform_get_drvdata(dev); + struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); + bool do_wakeup = device_may_wakeup(&pdev->dev); + int ret; if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + ohci_da8xx_clock(0); hcd->state = HC_STATE_SUSPENDED; - dev->dev.power.power_state = PMSG_SUSPEND; - return 0; + + return ret; } static int ohci_da8xx_resume(struct platform_device *dev)