From patchwork Wed Jun 19 12:12:16 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: 17993 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f198.google.com (mail-ye0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4A9922397B for ; Wed, 19 Jun 2013 12:13:33 +0000 (UTC) Received: by mail-ye0-f198.google.com with SMTP id m13sf6117054yen.5 for ; Wed, 19 Jun 2013 05:13:33 -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=nUZn6ffhkE74aPcqBTvvJn5IBwEQiNwM2+GXILbpgOE=; b=J71FhEpODs7PuwfoEJIiEyDUoDqHRV2lSfiGwbL8I/ZPF7UtedKyn1SBUIgo60b8Yq YYF+JKsQ0NF5U8ULkM75Ev2tphWqV4ZnjmUHMDT6pzwVGGnYIZ4zWRVaWPRupDUUQU8C EkRnTAhsCN9GUGLCEisRkjzhNImis4d2YTdym0Zp6Y5hLjNu4tKOqlkRlQRSrMIpwKP8 zzm1vHNJZj2mXW/CV885Q3tzWbD3kBeDrHixxh8XM3D02c8Np4l4h6GE3Mn2bhzi2b8+ yCe2lRC9HOqFSYVHEf28K+LSmgXxKdipQx38pdof414nB+Xf9ef12VhNYjwveZzGbVx2 ze2A== X-Received: by 10.236.194.33 with SMTP id l21mr1371149yhn.42.1371644013034; Wed, 19 Jun 2013 05:13:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.12.143 with SMTP id y15ls276801qeb.82.gmail; Wed, 19 Jun 2013 05:13:32 -0700 (PDT) X-Received: by 10.220.19.74 with SMTP id z10mr539235vca.45.1371644012873; Wed, 19 Jun 2013 05:13:32 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id z8si6445133vcu.39.2013.06.19.05.13.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id hv10so3679579vcb.22 for ; Wed, 19 Jun 2013 05:13:32 -0700 (PDT) X-Received: by 10.58.168.208 with SMTP id zy16mr871002veb.3.1371644012784; Wed, 19 Jun 2013 05:13:32 -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 yu8csp106253veb; Wed, 19 Jun 2013 05:13:32 -0700 (PDT) X-Received: by 10.68.13.168 with SMTP id i8mr2560885pbc.86.1371644011783; Wed, 19 Jun 2013 05:13:31 -0700 (PDT) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [2607:f8b0:400e:c03::22c]) by mx.google.com with ESMTPS id wx5si10740631pbc.353.2013.06.19.05.13.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:31 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22c is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::22c; Received: by mail-pa0-f44.google.com with SMTP id lj1so5114224pab.3 for ; Wed, 19 Jun 2013 05:13:31 -0700 (PDT) X-Received: by 10.66.183.196 with SMTP id eo4mr6415139pac.156.1371644011121; Wed, 19 Jun 2013 05:13:31 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id e2sm22925142pbc.23.2013.06.19.05.13.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:30 -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 V3 11/11] USB: OHCI: Properly handle ohci-spear suspend Date: Wed, 19 Jun 2013 17:42:16 +0530 Message-Id: <1371643936-3314-12-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQnXNm/lrAzWF2W/aECNvGcYvl81XLcsdLrojBt177/WruP5F4gp9WrxLJA0H+5Y5BuyFQaF X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 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-spear glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in spear_ohci_hcd_drv_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Cc: Arnd Bergmann Cc: Alan Stern 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". --- drivers/usb/host/ohci-spear.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 31ff3fc..a3b2696 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c @@ -130,20 +130,26 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev) } #if defined(CONFIG_PM) -static int spear_ohci_hcd_drv_suspend(struct platform_device *dev, +static int spear_ohci_hcd_drv_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); struct spear_ohci *sohci_p = to_spear_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; + clk_disable_unprepare(sohci_p->clk); - return 0; + return ret; } static int spear_ohci_hcd_drv_resume(struct platform_device *dev)