From patchwork Thu Jun 20 09:36:07 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: 18014 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9024B2393D for ; Thu, 20 Jun 2013 09:38:50 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 1sf8629372qec.3 for ; Thu, 20 Jun 2013 02:38:50 -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=UbbKNQhhM2l1SC3Oquxk0ab0/DYmnakIGegqNaAzirY=; b=kTpyqXlgwD1Y7lYCLLnw+0IcY6LiPyAClHOxhcsMcpzOnFWlziyAVLEXoOmzKLFCi/ sgNnok602crRe9gXzSORRiCeAqUGcIuvf5UZZkixsD3ki+v87osRiCuipqVp9SfnZJ8Y RqXiFkdwO3zQ8CyLlHhj2XTgXpaPEtCXkvpdfiifYFQ85CnDziSf3s0RQiKnscxtK6cE hNhkPuGECeM9eolU/4K06Rb3mC2RPZ9Q2BL4gh583Qf45fv4OL4OoUIM3xtvfK1VrhcZ JoQ6mLrvvzDx7jlE/OwRIPoUq72Vj4nHSpT2i8LxIQfDiuv5eWjpbhB3v4mz/VcHD+tb ntWg== X-Received: by 10.236.42.116 with SMTP id i80mr3758813yhb.26.1371721130388; Thu, 20 Jun 2013 02:38:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.99 with SMTP id ot3ls425483qeb.40.gmail; Thu, 20 Jun 2013 02:38:50 -0700 (PDT) X-Received: by 10.220.205.67 with SMTP id fp3mr2290416vcb.43.1371721130205; Thu, 20 Jun 2013 02:38:50 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id ha3si7614525vdb.147.2013.06.20.02.38.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 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.182; Received: by mail-vc0-f182.google.com with SMTP id id13so4523212vcb.41 for ; Thu, 20 Jun 2013 02:38:50 -0700 (PDT) X-Received: by 10.220.53.7 with SMTP id k7mr2229152vcg.52.1371721130113; Thu, 20 Jun 2013 02:38:50 -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 yu8csp13857veb; Thu, 20 Jun 2013 02:38:49 -0700 (PDT) X-Received: by 10.68.218.8 with SMTP id pc8mr6607496pbc.115.1371721128889; Thu, 20 Jun 2013 02:38:48 -0700 (PDT) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id sb1si13110591pbb.142.2013.06.20.02.38.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id t12so6011989pdi.7 for ; Thu, 20 Jun 2013 02:38:48 -0700 (PDT) X-Received: by 10.66.147.167 with SMTP id tl7mr10687265pab.40.1371721128509; Thu, 20 Jun 2013 02:38:48 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.192]) by mx.google.com with ESMTPSA id kq2sm35530pab.19.2013.06.20.02.38.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:47 -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 V4 11/11] USB: OHCI: Properly handle ohci-spear suspend Date: Thu, 20 Jun 2013 15:06:07 +0530 Message-Id: <1371720968-7533-12-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQnw+Q4+xfnrtyIeD2q5cojS4vGBAYjEArZSUKzPvAp+xnd7PYwsuszLfQLAmt0a2ZdOrqnn X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 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". V4: -The do_wakeup and ret variable alignment is removed. --- 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..41148f8 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)