From patchwork Wed Jun 19 12:12:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manjunath Goudar X-Patchwork-Id: 2750191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7AFC29F96B for ; Wed, 19 Jun 2013 15:39:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5524520403 for ; Wed, 19 Jun 2013 15:39:56 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 80DD1203FF for ; Wed, 19 Jun 2013 15:39:51 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpHIM-00075h-4m; Wed, 19 Jun 2013 12:15:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpHHS-0001Cq-EP; Wed, 19 Jun 2013 12:14:30 +0000 Received: from mail-pd0-f174.google.com ([209.85.192.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpHGV-000121-18 for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2013 12:13:32 +0000 Received: by mail-pd0-f174.google.com with SMTP id 10so4996756pdc.33 for ; Wed, 19 Jun 2013 05:13:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Tco2HsFk9OZw5Nho2KCWPeMAa1DvaV6vEBEpfAuZbIs=; b=cgyjalhxBOn0ZEwekkT6HTkLfr8vJf/sCmOf4p/YmSF2f1l8OTN19M40oWQBZv/d5J zxAv6dNGq3iwQxIImEtgtWx3l7wvthBAdJg98+I47Q3G0zAK1dqkSFx95zNP/Ol7g1T3 Pajj3T80A+pdipTX+ErPX+i4GDRGsrcTGXOPxduuvUVlpi9Slts59UNkCA3bgRu0T7Sp s63mDVJ6bK5pShk/VwnX1EHvfgUEbmAf0GSyAEMcI9S764DkjyM92be+pjHGHGksRR6j xJ/NP0SlZCNBmALqQ9krECZNO5jIJFrKBDqfAfGqWFEPm1DVeri2U3n+MI6OpKlkPjEs nnqg== X-Received: by 10.66.252.195 with SMTP id zu3mr6546955pac.185.1371643989562; Wed, 19 Jun 2013 05:13:09 -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.13.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:08 -0700 (PDT) From: Manjunath Goudar To: linux-usb@vger.kernel.org Subject: [PATCH V3 07/11] USB: OHCI: Properly handle ohci-omap suspend Date: Wed, 19 Jun 2013 17:42:12 +0530 Message-Id: <1371643936-3314-8-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: ALoCoQlue+zlsn5eqH+TDEG/lhg66bcIKK9ggXsqaPHcH/e6yLdiO8hjLspuw43QNAilBvtj3fQ0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130619_081331_210445_E47B4F85 X-CRM114-Status: GOOD ( 11.94 ) X-Spam-Score: -1.1 (-) Cc: linaro-kernel@lists.linaro.org, Arnd Bergmann , patches@linaro.org, Greg KH , manjunath.goudar@linaro.org, stern@rowland.harvard.edu, arnd@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Suspend scenario in case of ohci-omap glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_omap_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". --- drivers/usb/host/ohci-omap.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 10ba58d..4bd1e8f 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -432,16 +432,23 @@ static int ohci_hcd_omap_drv_remove(struct platform_device *dev) #ifdef CONFIG_PM -static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message) +static int ohci_omap_suspend(struct platform_device *pdev, pm_message_t message) { - struct ohci_hcd *ohci = hcd_to_ohci(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; + omap_ohci_clock_power(0); - return 0; + return ret; } static int ohci_omap_resume(struct platform_device *dev)