From patchwork Thu Jul 25 10:53:53 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: 18562 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3B19E25DF6 for ; Thu, 25 Jul 2013 10:54:30 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bq6sf1013413qab.6 for ; Thu, 25 Jul 2013 03:54:30 -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=FhFQr8LHqwYK2xqfG3zmJm2yYZQ0fKJKUacTX1vdYTM=; b=JcisTqb8kY4h6b0kq95XALuarRxUeTxV1g0P3xaavyX1BVsb3a+DUramFodGRPUNd/ o4SqVpQyVjG+klqfiIiUpYs14aHQjjYh2d9nYMsTCFb4z2MureBE1Gxw5QXYtyrYlT39 2XSV4cbqpRK7wYRM92MvcH7EGjiEAUEjgXGu29l8/rfhIiAJWWSClSmWyewt5XkruykU MVZynj+Ri9Hnv2jpnfNb9lAuo2t+gwDInWDlYaghA82ybSel4jvSKEkoO2EVc1vtfRTW r/QbZTlUZSeCpvS4Rcam9l/gizDRp+gWnFleBcRjsvzelzF4IxRPhgx8Wuw2//gDhlxc fLQw== X-Received: by 10.236.150.82 with SMTP id y58mr23339379yhj.5.1374749669981; Thu, 25 Jul 2013 03:54:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.3 with SMTP id l3ls585852qek.62.gmail; Thu, 25 Jul 2013 03:54:29 -0700 (PDT) X-Received: by 10.58.201.69 with SMTP id jy5mr17330320vec.29.1374749669763; Thu, 25 Jul 2013 03:54:29 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id ur15si12161220veb.108.2013.07.25.03.54.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 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.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so47502vcb.39 for ; Thu, 25 Jul 2013 03:54:29 -0700 (PDT) X-Received: by 10.58.135.227 with SMTP id pv3mr17437560veb.21.1374749669653; Thu, 25 Jul 2013 03:54:29 -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 yu8csp71154veb; Thu, 25 Jul 2013 03:54:29 -0700 (PDT) X-Received: by 10.68.143.199 with SMTP id sg7mr47596172pbb.13.1374749668635; Thu, 25 Jul 2013 03:54:28 -0700 (PDT) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by mx.google.com with ESMTPS id zs4si7204194pbb.166.2013.07.25.03.54.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.53 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.220.53; Received: by mail-pa0-f53.google.com with SMTP id lb1so1855230pab.26 for ; Thu, 25 Jul 2013 03:54:28 -0700 (PDT) X-Received: by 10.66.232.73 with SMTP id tm9mr25521113pac.159.1374749668255; Thu, 25 Jul 2013 03:54:28 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:27 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Date: Thu, 25 Jul 2013 16:23:53 +0530 Message-Id: <1374749640-30062-5-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> References: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmxK4Q4PFRS2GgASbNDczPo5beuDj3gDpdYhPugALtVKTwxYrCr6pVdgynDtKKFNq0AJX8a X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 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. 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". -pdev->dev.power.power_state stuff has been removed. V4: -Properly aligned "do_wakeup" and "ret" variable. --- drivers/usb/host/ohci-da8xx.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 6aaa9c9..280aea5 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -406,19 +406,26 @@ 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; if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + ohci_da8xx_clock(0); hcd->state = HC_STATE_SUSPENDED; - dev->dev.power.power_state = PMSG_SUSPEND; - return 0; + + return ret; } static int ohci_da8xx_resume(struct platform_device *dev)