From patchwork Wed Jun 19 12:12:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manjunath Goudar X-Patchwork-Id: 2750381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F1C62C0AB1 for ; Wed, 19 Jun 2013 16:19:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD95520239 for ; Wed, 19 Jun 2013 16:19:09 +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 3C3222022F for ; Wed, 19 Jun 2013 16:19:08 +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 1UpHKd-00087y-To; Wed, 19 Jun 2013 12:17:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpHJA-0001Gt-3u; Wed, 19 Jun 2013 12:16:16 +0000 Received: from mail-pd0-f180.google.com ([209.85.192.180]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpHGp-00016m-VE for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2013 12:13:53 +0000 Received: by mail-pd0-f180.google.com with SMTP id 10so4974393pdi.25 for ; Wed, 19 Jun 2013 05:13:31 -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=nUZn6ffhkE74aPcqBTvvJn5IBwEQiNwM2+GXILbpgOE=; b=R+NVTmZs3S0DuIRtkD6g1qkQ8SZMT5yhKnNCnGjvxUHmwV3A2pkSWLbe5Ko38Sf1W6 rLfSrN8uwqZ5fHtYOcc15ByLMgZiZ0edG5uovDpxI4YQ+NuxZXuqPbaWeg3ZCKnJz7+I z/ym7sLDTy96M5tqccoROlL/0l5GMUX4CgKW+dADIYPW2+Lh2xeVFn+G9xdYqboxF2sW PoEAdSYdSTix1bqk0tCU+HzQIWiHXjpCnuum2bt3rS9gbi2NOTE0vfmXuu8TbpOVu71m 9E1MUPIcyIJgWxvPHNruAEuQ0pnqpDVLdeDcV6WcYpw0c74LAbnr4Ugq+1chX6o2MeI+ HMIA== X-Received: by 10.66.183.196 with SMTP id eo4mr6415139pac.156.1371644011121; Wed, 19 Jun 2013 05:13:31 -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.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:30 -0700 (PDT) From: Manjunath Goudar To: linux-usb@vger.kernel.org Subject: [PATCH V3 11/11] USB: OHCI: Properly handle ohci-spear suspend Date: Wed, 19 Jun 2013 17:42:16 +0530 Message-Id: <1371643936-3314-12-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: ALoCoQkypEigSXpceuwJVkloym+dI82h/Lt6ZPqZ+TMLjZoA+WnaDG8c4AZdg33/VlyNp/fZ7xlo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130619_081352_135899_C7CD558D X-CRM114-Status: GOOD ( 12.29 ) 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-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 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-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..a3b2696 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)