From patchwork Tue Oct 15 13:20:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Majunath Goudar X-Patchwork-Id: 3045361 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 C8CE89F243 for ; Tue, 15 Oct 2013 13:55:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86DC720266 for ; Tue, 15 Oct 2013 13:55:01 +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 6D8DA201D3 for ; Tue, 15 Oct 2013 13:54:59 +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 1VW4aq-0002wP-8M; Tue, 15 Oct 2013 13:23:27 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VW4Zy-0007zb-TF; Tue, 15 Oct 2013 13:22:32 +0000 Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VW4Yh-0007rL-IM for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2013 13:21:12 +0000 Received: by mail-pd0-f169.google.com with SMTP id r10so8860655pdi.0 for ; Tue, 15 Oct 2013 06:20:48 -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=2DhbXpL8V/eJ+zPlc72ibS/RmkZ9/g8fp6ogerD72kc=; b=ETzhrPMOFHYxCLBKwYszLGhsBYhLEAjcHXOgQJgUSibxV3REe8qZruPDTUpwjytv53 8WkdWLFKpAGds2zHHd4w3zSBEO5SX1apNYV6v+aVHnaCXg8NuL8N7+OHv63+lfh4eGj0 fYQdB4YINM9I6VwRdQW9MjYwQBhKlQ/hK4j5ajKwKXQu0pjeoTiWOA70zcbAGPBwA6Tv mENhbRQrhW/0G7hxZFJSgBFi34PXcBqLhz7meqtJe8n3PvseKdfgPtxKBgu8eR3/Dnux Kb9OKnzv0aKy1FNRid8Qrv+suqeAKecyRZ9qRe+p3ez6FfngPfK/xSe8J3IHKB2edQ52 qLCQ== X-Received: by 10.67.3.34 with SMTP id bt2mr43474906pad.3.1381843248300; Tue, 15 Oct 2013 06:20:48 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id bp4sm82010358pbb.42.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 06:20:47 -0700 (PDT) From: Majunath Goudar To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 7/7] USB: OHCI: Properly handle ohci-spear suspend Date: Tue, 15 Oct 2013 18:50:02 +0530 Message-Id: <1381843202-28707-8-git-send-email-csmanjuvijay@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381843202-28707-1-git-send-email-csmanjuvijay@gmail.com> References: <1380708947-15966-1-git-send-email-csmanjuvijay@gmail.com> <1381843202-28707-1-git-send-email-csmanjuvijay@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131015_092111_721233_6FF8AE2A X-CRM114-Status: GOOD ( 13.61 ) X-Spam-Score: 0.1 (/) Cc: Arnd Bergmann , Greg KH , Manjunath Goudar , linux-usb@vger.kernel.org, Manjunath Goudar , Alan Stern 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=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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-spear glue was not properly handled as it was not suspending generic part of ohci controller. Alan Stern suggested, properly handle ohci-spear suspend scenario. Calling explicitly the ohci_suspend() routine in spear_ohci_hcd_drv_suspend() will ensure proper handling of suspend scenario. V1->V2: -No changes. Due to the build failure on ep93xx reverted this patch. This patch is needed as Alan Stern suggestion. Signed-off-by: Manjunath Goudar Signed-off-by: Manjunath Goudar Cc: Alan Stern Cc: Arnd Bergmann Cc: Greg KH Cc: linux-usb@vger.kernel.org --- 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)