From patchwork Wed Oct 2 10:15:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Majunath Goudar X-Patchwork-Id: 2974071 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 686859F2B8 for ; Wed, 2 Oct 2013 10:19:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAFFA203A8 for ; Wed, 2 Oct 2013 10:19:04 +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 6FF53203A3 for ; Wed, 2 Oct 2013 10:19:03 +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 1VRJUv-0000rW-C5; Wed, 02 Oct 2013 10:17:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRJUb-0003Ie-Kb; Wed, 02 Oct 2013 10:17:17 +0000 Received: from mail-pb0-x233.google.com ([2607:f8b0:400e:c01::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRJU9-0003BS-0J for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2013 10:16:50 +0000 Received: by mail-pb0-f51.google.com with SMTP id jt11so672538pbb.24 for ; Wed, 02 Oct 2013 03:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EdPV25/zH/llCuGFk6rphDX27V4YPW5KyXY11zgJg8U=; b=FbbuvF1fr7yCfvaNi1COZBTJlyEC8oSzyrjddKr8Wqi+hFrTp8wQtSpXZH7JS9BK8F kKbTx6MagqhNKeCO3bkxdqHyKTK1xuo+if3r2fGFQ/i5y82/ViZtY9pjm04hriIUXHCd g351JJ6Z9KH6wiTOXdk1ti6/iHdBjKC7T7Yat5OD7Wawfvocs9U0yEaWShN5x8vtWtri Xm9YYLVIaruCwUpaKGlohaFGV8bCoh7Cevnl9w9VYUkwg4o/1ivjCu5wAsWv4DGwmyD0 UPhBsfEGomQIKbdPJ0kzdr3jY6qRl2aTaCMTovhGW+qu+7o2IjPUXh8QcAD5Hdcotg66 COdA== X-Received: by 10.69.12.36 with SMTP id en4mr1689243pbd.54.1380708987373; Wed, 02 Oct 2013 03:16:27 -0700 (PDT) Received: from localhost.localdomain ([27.61.190.42]) by mx.google.com with ESMTPSA id qw8sm1149855pbb.27.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Oct 2013 03:16:26 -0700 (PDT) From: Majunath Goudar To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Date: Wed, 2 Oct 2013 15:45:40 +0530 Message-Id: <1380708947-15966-5-git-send-email-csmanjuvijay@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1380708947-15966-1-git-send-email-csmanjuvijay@gmail.com> References: <1380708947-15966-1-git-send-email-csmanjuvijay@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131002_061649_159123_FCF06AB2 X-CRM114-Status: GOOD ( 13.51 ) X-Spam-Score: -2.0 (--) Cc: Arnd Bergmann , Greg KH , Manjunath Goudar , linux-usb@vger.kernel.org, Manjunath Goudar , nataraja.km@lge.com 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, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Manjunath Goudar Suspend scenario in case of ohci-da8xx glue was not properly handled as it was not suspending generic part of ohci controller. Alan Stern suggested, properly handle ohci-da8xx suspend scenario. Calling explicitly the ohci_suspend() routine in ohci_da8xx_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Signed-off-by: Manjunath Goudar Acked-by: Alan Stern Cc: Arnd Bergmann Cc: Greg KH Cc: linux-usb@vger.kernel.org --- 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 9be59f1..f8238a4 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)