From patchwork Tue Jun 25 06:39:39 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: 18092 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f200.google.com (mail-gh0-f200.google.com [209.85.160.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9CDC425D00 for ; Tue, 25 Jun 2013 06:40:32 +0000 (UTC) Received: by mail-gh0-f200.google.com with SMTP id 10sf12537600ghy.3 for ; Mon, 24 Jun 2013 23:40:32 -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=zur/WwbgvTUUoEu3szq63I8H4DET0tYndbgaSvxaFN0=; b=Onvo8+ty2EPihSbcKUVSqlUTVkfgppUyoTrNuMmWLhhjlvEc48og58dn2ayZE+tdSb fU61ABeGH0OuAS7ihNn6GaCyxNev9KNSP0tyrkIvPClY59e6qrzyer13cHM2tomVzWQ1 B3nFvTYuc70yjVb4iSKB7u/6H9BqRkHOKDaQF4ksBaovJVvu6SYVx1p4IqAtgb+vFm+s essTz0Kca0T852m9DFipfBAHTihIq428uvVt8Z81q3L2cR261rye5ipr23Ew6pBOV2DL 9J5RQ0b9WRO0VMH3SMZ5xmIVU2JX2M+ZvfAGyhYZlI3MyH6ITloXKLrVWBPjaOyRfAff yxEQ== X-Received: by 10.236.15.73 with SMTP id e49mr15481975yhe.15.1372142432427; Mon, 24 Jun 2013 23:40:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.12.233 with SMTP id b9ls2221809qec.14.gmail; Mon, 24 Jun 2013 23:40:32 -0700 (PDT) X-Received: by 10.52.165.209 with SMTP id za17mr11205185vdb.60.1372142432263; Mon, 24 Jun 2013 23:40:32 -0700 (PDT) Received: from mail-vb0-x22e.google.com (mail-vb0-x22e.google.com [2607:f8b0:400c:c02::22e]) by mx.google.com with ESMTPS id ia10si5872392vdb.129.2013.06.24.23.40.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:32 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22e 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::22e; Received: by mail-vb0-f46.google.com with SMTP id 10so8931064vbe.5 for ; Mon, 24 Jun 2013 23:40:32 -0700 (PDT) X-Received: by 10.58.45.70 with SMTP id k6mr13751223vem.9.1372142432182; Mon, 24 Jun 2013 23:40: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.165.8 with SMTP id yu8csp55561veb; Mon, 24 Jun 2013 23:40:31 -0700 (PDT) X-Received: by 10.66.219.38 with SMTP id pl6mr31035662pac.59.1372142430906; Mon, 24 Jun 2013 23:40:30 -0700 (PDT) Received: from mail-pb0-x231.google.com (mail-pb0-x231.google.com [2607:f8b0:400e:c01::231]) by mx.google.com with ESMTPS id hq6si332625pad.153.2013.06.24.23.40.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:30 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::231 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::231; Received: by mail-pb0-f49.google.com with SMTP id jt11so12173379pbb.36 for ; Mon, 24 Jun 2013 23:40:30 -0700 (PDT) X-Received: by 10.68.167.99 with SMTP id zn3mr27343458pbb.216.1372142430534; Mon, 24 Jun 2013 23:40:30 -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.40.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:29 -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 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Date: Tue, 25 Jun 2013 12:09:39 +0530 Message-Id: <1372142386-10691-5-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: ALoCoQlF5U4/cODPy+mEiEXwb168ddUOoCE/5Yel0z32QGZW/6FDP1uKfbfrNAB+qC+H4b2MSX+L X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22e 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..c649a35 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)