From patchwork Wed Jun 19 12:12:09 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: 17986 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 08D312397B for ; Wed, 19 Jun 2013 12:12:57 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id d41sf4885533eek.3 for ; Wed, 19 Jun 2013 05:12:57 -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=cmGtc/RnRT7/29KV89vHzQtlRW1YtfshQNzncWQNsGg=; b=hOirbU4oDeQ3fJ0THOVNDa8O75BcfcKPl1VGg39PkjWjapndqvARgkL8Tb267xKaTg BM8yH4s71seLYw95JSWVNI+Ey5sR3TBGIV3Ft0y1Iy/Z27vpZQ7OSpAXFYEKBeZfsBQi +7malbTSTJuvufMikti3XbP5GBgOvU0lYaZJRc8xO36YhroXgixXlas1fQ6kv8F2PLO2 EUM52Pg5KGt11AUwVYk3/5iZTW/zQ135BSkrsSppwHjP1xNBLDFXLkjos/QXgRndMAp8 qUDWrPA04A2SkjTW8wglbJJAAWeK+HdlpCOCQMRjMk8m5BXxemi7e1gelXBC6gN7NnFY ungQ== X-Received: by 10.180.98.100 with SMTP id eh4mr1049017wib.4.1371643976957; Wed, 19 Jun 2013 05:12:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.97.10 with SMTP id dw10ls312780wib.8.canary; Wed, 19 Jun 2013 05:12:56 -0700 (PDT) X-Received: by 10.180.9.35 with SMTP id w3mr1846035wia.46.1371643976747; Wed, 19 Jun 2013 05:12:56 -0700 (PDT) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [2607:f8b0:400c:c01::232]) by mx.google.com with ESMTPS id gc10si2533317wic.6.2013.06.19.05.12.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:56 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::232 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::232; Received: by mail-ve0-f178.google.com with SMTP id pb11so3953514veb.37 for ; Wed, 19 Jun 2013 05:12:55 -0700 (PDT) X-Received: by 10.220.70.140 with SMTP id d12mr523558vcj.15.1371643975659; Wed, 19 Jun 2013 05:12:55 -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 yu8csp106218veb; Wed, 19 Jun 2013 05:12:54 -0700 (PDT) X-Received: by 10.66.118.129 with SMTP id km1mr6322042pab.112.1371643974527; Wed, 19 Jun 2013 05:12:54 -0700 (PDT) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [2607:f8b0:400e:c03::22e]) by mx.google.com with ESMTPS id qu10si10752212pbc.222.2013.06.19.05.12.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:54 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22e is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::22e; Received: by mail-pa0-f46.google.com with SMTP id fa11so5068763pad.5 for ; Wed, 19 Jun 2013 05:12:54 -0700 (PDT) X-Received: by 10.66.240.41 with SMTP id vx9mr6417889pac.93.1371643974029; Wed, 19 Jun 2013 05:12:54 -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.12.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:53 -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 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Date: Wed, 19 Jun 2013 17:42:09 +0530 Message-Id: <1371643936-3314-5-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: ALoCoQm8demYQ6uy5qJ5IUCy8RisGm2e8r3o3KyRXXvclxwg3Koo+yh7eVC5DkA3yPQEio04HgWP X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::232 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 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". -pdev->dev.power.power_state stuff has been removed. --- drivers/usb/host/ohci-da8xx.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 6aaa9c9..78a6124 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->next_statechange = jiffies; 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)