From patchwork Thu Jun 13 09:10:54 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: 17870 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 34A3E25BE0 for ; Thu, 13 Jun 2013 09:11:33 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id a11sf7323668qen.4 for ; Thu, 13 Jun 2013 02:11: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=2RQ3xFqC2vgkrEhv2vbDH6VkLmkgZtCuKnyY6RSFlrI=; b=BNh0LE1ZKj044JSUmMotDrfIqHemgd8vptWyv3KzA88Ma0sJ4lwnPqwnrOqou4WN0U Tit/FG/XN7ajg7jHOM2FErynDVltXBPCwYioglyx/lTHoTAjSbifUBF9wgvXwTzBY2W/ lTdv4xEaPuiSXMqX4HcqmFavggqBVh+eRbmVNF8l2Be8Lgs9TrJYP9WszzyngbPJ+RjE mhD/pLgmV4D3FwzWH6GJ9Z5r9uDn/Jh+tWsHyUV0P/I1mtykmbSWRm4pkrswur0TgwwP ih8ON0hukDK77+Yqp9P8iLF9YnBe3ei2SHtLyMs27PMGtKJKoQd8y4vjxtMHdC9RSfRK RfUw== X-Received: by 10.236.70.170 with SMTP id p30mr1262yhd.5.1371114692936; Thu, 13 Jun 2013 02:11:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.20 with SMTP id cy20ls920391qeb.11.gmail; Thu, 13 Jun 2013 02:11:32 -0700 (PDT) X-Received: by 10.220.104.135 with SMTP id p7mr11118863vco.10.1371114692765; Thu, 13 Jun 2013 02:11:32 -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 k12si10071572vcp.87.2013.06.13.02.11.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:32 -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 cz10so7454162veb.8 for ; Thu, 13 Jun 2013 02:11:32 -0700 (PDT) X-Received: by 10.52.171.80 with SMTP id as16mr9584273vdc.90.1371114692646; Thu, 13 Jun 2013 02:11: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.191.99 with SMTP id gx3csp13557vec; Thu, 13 Jun 2013 02:11:32 -0700 (PDT) X-Received: by 10.66.231.7 with SMTP id tc7mr1851501pac.143.1371114691568; Thu, 13 Jun 2013 02:11:31 -0700 (PDT) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [2607:f8b0:400e:c03::232]) by mx.google.com with ESMTPS id sb1si11307272pbb.352.2013.06.13.02.11.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:31 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::232 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::232; Received: by mail-pa0-f50.google.com with SMTP id fb1so7778416pad.9 for ; Thu, 13 Jun 2013 02:11:31 -0700 (PDT) X-Received: by 10.66.243.4 with SMTP id wu4mr1907688pac.72.1371114691183; Thu, 13 Jun 2013 02:11:31 -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.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11: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-dev@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH 03/10] USB: OHCI: Properly handle ohci-da8xx suspend Date: Thu, 13 Jun 2013 14:40:54 +0530 Message-Id: <1371114661-2207-4-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: ALoCoQlR8hBPoC5Z93AAKc52EXVaATC4fVCWpJifQcyb7xE0b+jCc4ydMix4vGE0AWKGPiFSTb7Q 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-da8xx glue was not properly handled as it was not suspending generic part of ohci controller.Calling explicitly the ohci_suspend() routine in ohci_da8xx_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-da8xx.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 6aaa9c9..8d4914d 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -406,10 +406,21 @@ static int ohci_hcd_da8xx_drv_remove(struct platform_device *dev) } #ifdef CONFIG_PM -static int ohci_da8xx_suspend(struct platform_device *dev, pm_message_t message) +static int ohci_da8xx_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); + 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); @@ -417,8 +428,8 @@ static int ohci_da8xx_suspend(struct platform_device *dev, pm_message_t message) ohci_da8xx_clock(0); hcd->state = HC_STATE_SUSPENDED; - dev->dev.power.power_state = PMSG_SUSPEND; - return 0; + pdev->dev.power.power_state = PMSG_SUSPEND; + return ret; } static int ohci_da8xx_resume(struct platform_device *dev)