From patchwork Wed Jun 19 12:12:12 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: 17989 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AE66A2397B for ; Wed, 19 Jun 2013 12:13:13 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 13sf5031851lba.9 for ; Wed, 19 Jun 2013 05:13:12 -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=Tco2HsFk9OZw5Nho2KCWPeMAa1DvaV6vEBEpfAuZbIs=; b=b+CgXHF4isVgPHOZBgksgTzZs8IM/WuRuWn+UMbmNpY6Xod6ZoUzFFeUI3xrxHuu7r dEm9eJ8Jgx3/AeH2SOGVNOYpi9ab1EEqJ5s0hdx3msxCx3G2A8mqx5UDfhvtwTJ/ZMDw +eRN3sb1ivb3enqjwI9me2ShSTSrErYlaXtSkqz+408hCmtNJ9s5/0OdZ3PyG5U5DZdR QI8Ojgo7NQPONXMiuJ6S5pjyMMsO15cTW5aZ5eQDeT38QIG9qMIdtHOx+9TQsswxQyg6 1WOvpIT1d+HFODQOdKT94HNyvxU0HsHoWZBEbRZNcCpu+8N38nqbVZ3TNe6fHqFfP1ZH SJpA== X-Received: by 10.180.76.76 with SMTP id i12mr1049054wiw.6.1371643992364; Wed, 19 Jun 2013 05:13:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.97.130 with SMTP id ea2ls388582wib.24.canary; Wed, 19 Jun 2013 05:13:12 -0700 (PDT) X-Received: by 10.180.207.43 with SMTP id lt11mr10661767wic.57.1371643992155; Wed, 19 Jun 2013 05:13:12 -0700 (PDT) Received: from mail-ve0-x231.google.com (mail-ve0-x231.google.com [2607:f8b0:400c:c01::231]) by mx.google.com with ESMTPS id f4si2518788wiv.51.2013.06.19.05.13.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:12 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::231 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::231; Received: by mail-ve0-f177.google.com with SMTP id cz10so3976408veb.36 for ; Wed, 19 Jun 2013 05:13:11 -0700 (PDT) X-Received: by 10.52.120.77 with SMTP id la13mr717239vdb.23.1371643991064; Wed, 19 Jun 2013 05:13:11 -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 yu8csp106235veb; Wed, 19 Jun 2013 05:13:10 -0700 (PDT) X-Received: by 10.68.213.231 with SMTP id nv7mr2596794pbc.70.1371643989947; Wed, 19 Jun 2013 05:13:09 -0700 (PDT) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [2607:f8b0:400e:c03::235]) by mx.google.com with ESMTPS id ph3si8030593pbc.44.2013.06.19.05.13.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:09 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::235 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::235; Received: by mail-pa0-f53.google.com with SMTP id tj12so5060734pac.40 for ; Wed, 19 Jun 2013 05:13:09 -0700 (PDT) X-Received: by 10.66.252.195 with SMTP id zu3mr6546955pac.185.1371643989562; Wed, 19 Jun 2013 05:13:09 -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.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:08 -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 07/11] USB: OHCI: Properly handle ohci-omap suspend Date: Wed, 19 Jun 2013 17:42:12 +0530 Message-Id: <1371643936-3314-8-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: ALoCoQnF0tyUaEyeGuoYG9KzvPuG36oJ9wMr6uAt9lHJ6ZNHbwR+5IpoLqGsNylbxuLKwvZPSOrQ X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::231 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-omap glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_omap_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-omap.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 10ba58d..4bd1e8f 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -432,16 +432,23 @@ static int ohci_hcd_omap_drv_remove(struct platform_device *dev) #ifdef CONFIG_PM -static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message) +static int ohci_omap_suspend(struct platform_device *pdev, pm_message_t message) { - struct ohci_hcd *ohci = hcd_to_ohci(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; + omap_ohci_clock_power(0); - return 0; + return ret; } static int ohci_omap_resume(struct platform_device *dev)