From patchwork Tue Jun 25 06:39:46 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: 18099 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9597A25D00 for ; Tue, 25 Jun 2013 06:41:09 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id f73sf17385193yha.6 for ; Mon, 24 Jun 2013 23:41:09 -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=2Ktvla48lTvqqRrILp74RXbjvblOz5rgOQATC3fGbCM=; b=SeV2+jjNJ4CyciCmAisO4ZUmZfnfZD7SnsbL9bjbyTKws1e7VE2TfdOVHZyXOLtdbS t3ikCsZIDJqgSBHEmDAGGKxUoJo2Q40jXAR7zUl9fA4dGX7TPrKtlnFbFCHNUSdIXzrF Vv3Z6XFjMZXXhc9MMFZxRNO9bkSASNGWTOUdL5e65sXT20ihyXc6BpizGZNosd890Nnx p/h+sEgCDOzQnte2WBR1f7BZ+p742rqgh8hO1AXAzKzGTZS3rQ6vXew3yMrNy6O1fANd NtXDkncYmLz4Vozs+ZlyaYY1JG854U61vVhKxVqHG1rCM3lK704i7XhYof9ZUkeq00YI bw1Q== X-Received: by 10.236.63.37 with SMTP id z25mr14914473yhc.49.1372142469415; Mon, 24 Jun 2013 23:41:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.51 with SMTP id r19ls2261129qef.73.gmail; Mon, 24 Jun 2013 23:41:09 -0700 (PDT) X-Received: by 10.58.96.76 with SMTP id dq12mr13367233veb.91.1372142469253; Mon, 24 Jun 2013 23:41:09 -0700 (PDT) Received: from mail-vb0-x231.google.com (mail-vb0-x231.google.com [2607:f8b0:400c:c02::231]) by mx.google.com with ESMTPS id aj7si5885279vec.59.2013.06.24.23.41.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:41:09 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::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:c02::231; Received: by mail-vb0-f49.google.com with SMTP id 12so8943384vbf.22 for ; Mon, 24 Jun 2013 23:41:09 -0700 (PDT) X-Received: by 10.52.118.38 with SMTP id kj6mr4830032vdb.21.1372142469170; Mon, 24 Jun 2013 23:41:09 -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 yu8csp55582veb; Mon, 24 Jun 2013 23:41:08 -0700 (PDT) X-Received: by 10.68.171.36 with SMTP id ar4mr26391166pbc.195.1372142468095; Mon, 24 Jun 2013 23:41:08 -0700 (PDT) Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [2607:f8b0:400e:c01::235]) by mx.google.com with ESMTPS id ol10si10630138pbb.64.2013.06.24.23.41.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:41:08 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::235 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::235; Received: by mail-pb0-f53.google.com with SMTP id xb12so12046832pbc.26 for ; Mon, 24 Jun 2013 23:41:07 -0700 (PDT) X-Received: by 10.68.202.41 with SMTP id kf9mr26423138pbc.80.1372142467721; Mon, 24 Jun 2013 23:41:07 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id mr3sm6037160pbb.27.2013.06.24.23.41.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:41:07 -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 V4 11/11] USB: OHCI: Properly handle ohci-spear suspend Date: Tue, 25 Jun 2013 12:09:46 +0530 Message-Id: <1372142386-10691-12-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQlsfCnYhaiSEiCIElNYNE+XYFJSZ98getXwlEBxRBjrwnbjnW5EnFxem3aaqEG6RFbv2+lA X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::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-spear glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in spear_ohci_hcd_drv_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". V4: -The do_wakeup and ret variable alignment is removed. --- drivers/usb/host/ohci-spear.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 31ff3fc..41148f8 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c @@ -130,20 +130,26 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev) } #if defined(CONFIG_PM) -static int spear_ohci_hcd_drv_suspend(struct platform_device *dev, +static int spear_ohci_hcd_drv_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); struct spear_ohci *sohci_p = to_spear_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; + clk_disable_unprepare(sohci_p->clk); - return 0; + return ret; } static int spear_ohci_hcd_drv_resume(struct platform_device *dev)