From patchwork Tue Jun 25 06:39:40 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: 18093 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 26C0125D00 for ; Tue, 25 Jun 2013 06:40:40 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id fe20sf10706594lab.6 for ; Mon, 24 Jun 2013 23:40:39 -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=4nZowkTnSgyqH5NZgcCo9K27KsM/+mQ3OcZ8f6Lf/gs=; b=LoUJSrHd2xITREHrjgAw47koHboNraUpUSOVPFeencsb4bb4B6M2+alG6ryo0Fg9L/ 3Jez7s7oRziNEjxfpEJVLEno8KGGKpqyaMFvcuQj8zmrb4mPOLNa63GgSPasXmRkvmCJ vZO+rWS4nCNmECl1jr65kKuze76tN6G/MBH3zRfpVplMfarxlU9thjo6JCGJpR9ovoyp oYbvkqegq8D8yBMJORkN27LMRYdaBl1kerCumXmCH4RKv9ZRmsBi1FnHap1xjG6exquU a5EeKUlkqkoKbmx4+WszPdk4JaAPtIZ/mdAu1uXX/0WmUSAAOOSpuRXAF9I9DiLqHYky r1bg== X-Received: by 10.180.207.44 with SMTP id lt12mr4216394wic.5.1372142438906; Mon, 24 Jun 2013 23:40:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.83.71 with SMTP id o7ls1011678wiy.33.gmail; Mon, 24 Jun 2013 23:40:38 -0700 (PDT) X-Received: by 10.194.48.116 with SMTP id k20mr19573150wjn.23.1372142438625; Mon, 24 Jun 2013 23:40:38 -0700 (PDT) Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com [2607:f8b0:400c:c01::22a]) by mx.google.com with ESMTPS id l5si7358972wje.115.2013.06.24.23.40.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:38 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22a 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:c01::22a; Received: by mail-ve0-f170.google.com with SMTP id 14so9676442vea.15 for ; Mon, 24 Jun 2013 23:40:37 -0700 (PDT) X-Received: by 10.58.215.200 with SMTP id ok8mr13500712vec.21.1372142437577; Mon, 24 Jun 2013 23:40:37 -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 yu8csp55564veb; Mon, 24 Jun 2013 23:40:36 -0700 (PDT) X-Received: by 10.66.26.20 with SMTP id h20mr30162663pag.180.1372142436091; Mon, 24 Jun 2013 23:40:36 -0700 (PDT) Received: from mail-pd0-x22a.google.com (mail-pd0-x22a.google.com [2607:f8b0:400e:c02::22a]) by mx.google.com with ESMTPS id iw6si10869097pac.333.2013.06.24.23.40.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:36 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c02::22a is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c02::22a; Received: by mail-pd0-f170.google.com with SMTP id x11so803351pdj.1 for ; Mon, 24 Jun 2013 23:40:35 -0700 (PDT) X-Received: by 10.68.235.103 with SMTP id ul7mr27496302pbc.14.1372142435695; Mon, 24 Jun 2013 23:40:35 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id mr3sm6037160pbb.27.2013.06.24.23.40.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:35 -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 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Date: Tue, 25 Jun 2013 12:09:40 +0530 Message-Id: <1372142386-10691-6-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQlF0AKkMDpBESaexReiYiWxUAKULUwM68M4+0B+b3aqbZSJhTYkanF1b2syt9nCyrgXKMMV X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22a 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-ep93xx glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_hcd_ep93xx_drv_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". V4: -The do_wakeup and ret variable alignment is removed. --- drivers/usb/host/ohci-ep93xx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index 8704e9f..f0aaa48 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c @@ -174,13 +174,20 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_ { 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; + ep93xx_stop_hc(&pdev->dev); - return 0; + + return ret; } static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)