From patchwork Thu Jun 13 09:10:57 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: 17873 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0571025BE0 for ; Thu, 13 Jun 2013 09:11:49 +0000 (UTC) Received: by mail-we0-f198.google.com with SMTP id q59sf10258326wes.5 for ; Thu, 13 Jun 2013 02:11:49 -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=v7Rhmij2mEZgwn2kgIpmDhrLkk32bFa56GEnp7/hQgs=; b=Bi9/HDhjhz6/j++PNnrmrhuU8lKOf0hX0d8pxqNF7hoWSnjCiIe38d/Ho305pp08QA maNBPEyIBZOlQsRkILzvYGEU8sGuCsPG7azUm2K3ntlJC9Y7Wc91tNBYE6mL357sVC7e S/9jyjhvoymfpoLQtBzENZGdkp21oth8YnyrFbfuT8fkVU4qs05MgKCsbU4UIM68tbPM CX8+1ngh+TTJDTHEr4rWyLzaZ+PJc7ozp34Ys35IhyY1PdE2OlqLfLtxmH7slDcDPw2f 8jUeXCFlY0QYwQbTwvAGOvFeKX6v5zizv3hYXOyIHD5WdSLJKwEY/bdjs8UObb6GhIQY aAQg== X-Received: by 10.180.76.76 with SMTP id i12mr582wiw.6.1371114708887; Thu, 13 Jun 2013 02:11:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.76.6 with SMTP id g6ls406642wiw.0.gmail; Thu, 13 Jun 2013 02:11:48 -0700 (PDT) X-Received: by 10.194.58.11 with SMTP id m11mr12484316wjq.45.1371114708774; Thu, 13 Jun 2013 02:11:48 -0700 (PDT) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [2607:f8b0:400c:c01::230]) by mx.google.com with ESMTPS id y5si6779580wie.11.2013.06.13.02.11.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:48 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::230 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::230; Received: by mail-ve0-f176.google.com with SMTP id c13so7441044vea.21 for ; Thu, 13 Jun 2013 02:11:47 -0700 (PDT) X-Received: by 10.220.215.73 with SMTP id hd9mr280080vcb.19.1371114707682; Thu, 13 Jun 2013 02:11:47 -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.191.99 with SMTP id gx3csp13566vec; Thu, 13 Jun 2013 02:11:47 -0700 (PDT) X-Received: by 10.68.36.197 with SMTP id s5mr3290pbj.23.1371114706737; Thu, 13 Jun 2013 02:11:46 -0700 (PDT) Received: from mail-pb0-x230.google.com (mail-pb0-x230.google.com [2607:f8b0:400e:c01::230]) by mx.google.com with ESMTPS id zl3si7975170pbc.190.2013.06.13.02.11.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:46 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::230 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::230; Received: by mail-pb0-f48.google.com with SMTP id ma3so4677983pbc.35 for ; Thu, 13 Jun 2013 02:11:46 -0700 (PDT) X-Received: by 10.68.48.197 with SMTP id o5mr24321750pbn.184.1371114706353; Thu, 13 Jun 2013 02:11:46 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id p2sm28451974pag.22.2013.06.13.02.11.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:45 -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-dev@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH 06/10] USB: OHCI: Properly handle ohci-omap suspend Date: Thu, 13 Jun 2013 14:40:57 +0530 Message-Id: <1371114661-2207-7-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371114661-2207-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371114661-2207-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQk6NXVXBKVgJEzBsl4zAmyGdPsl1HixFGoMhfpycd3baT4jf+qk6bLnMX5iEuaPnt4VkZAV X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::230 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. V2: -Incase ohci_suspend() fails, return right away without executing further. Signed-off-by: Manjunath Goudar Cc: Arnd Bergmann Cc: Alan Stern Cc: Greg KH Cc: linux-usb@vger.kernel.org --- drivers/usb/host/ohci-omap.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index b900dba..9144315 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -423,16 +423,27 @@ 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; + + ret = ohci_suspend(hcd, do_wakeup); + if (ret == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) { + ohci_resume(hcd, false); + ret = -EBUSY; + } + if (ret) + return ret; if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; omap_ohci_clock_power(0); - return 0; + return ret; } static int ohci_omap_resume(struct platform_device *dev)