From patchwork Thu Oct 3 13:02:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Majunath Goudar X-Patchwork-Id: 2982881 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 1CC7B9F288 for ; Thu, 3 Oct 2013 13:37:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5465D20373 for ; Thu, 3 Oct 2013 13:37:46 +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 858C02035D for ; Thu, 3 Oct 2013 13:37:41 +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 1VRiaJ-0007Ur-6l; Thu, 03 Oct 2013 13:04: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 1VRiZZ-00029x-Md; Thu, 03 Oct 2013 13:04:05 +0000 Received: from mail-pd0-x22a.google.com ([2607:f8b0:400e:c02::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRiYx-00021r-B1 for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2013 13:03:28 +0000 Received: by mail-pd0-f170.google.com with SMTP id x10so2441626pdj.15 for ; Thu, 03 Oct 2013 06:03:04 -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=e8SQ9C7dNoqkH24MYedtboxFv47YSCGmBJUfdtwMV2Q=; b=p7+7HlMkn39frLh4ccCbxpnLd2neLf9QAS945copgZLRXu0o0ByLeEMRVQfvRGjh1W bkJ85MazKco+AU82cIAAHd4WDY2Q+PHuxGGisJ6WCnyuke3mX1zUkEBxr6ZbpZqe9S8W ZUwz/yl5dn79N0VhKOvo0ZkLSq2psezwOoIakibN9e4/NGPdoSmk6SftkL52TTn9+L8p JGHoSuL8wMMPjMBCgsfZA6fUp19VSwkHdbOxGbiRlO6BH8MlRr7gXTewQWvz0KHCAHg1 s9F4ZfPYoWNKSfhhKrVK7jFn2ZZkgxf5tBPFFp8ALhWu47bYonGA49gZLxIImZCxB4jY vBeQ== X-Received: by 10.68.253.1 with SMTP id zw1mr8454502pbc.30.1380805384126; Thu, 03 Oct 2013 06:03:04 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id ed3sm8176746pbc.6.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 06:03:03 -0700 (PDT) From: Majunath Goudar To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 06/11] USB: OHCI: Properly handle ohci-exynos suspend Date: Thu, 3 Oct 2013 18:32:08 +0530 Message-Id: <1380805334-19934-7-git-send-email-csmanjuvijay@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1380805334-19934-1-git-send-email-csmanjuvijay@gmail.com> References: <1380708947-15966-1-git-send-email-csmanjuvijay@gmail.com> <1380805334-19934-1-git-send-email-csmanjuvijay@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131003_090327_534813_A1AC79DA X-CRM114-Status: GOOD ( 12.65 ) X-Spam-Score: 0.1 (/) Cc: Manjunath Goudar , Arnd Bergmann , Bartlomiej Zolnierkiewicz , Greg KH , Manjunath Goudar , linux-usb@vger.kernel.org, Manjunath Goudar , Alan Stern , 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=-2.6 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-exynos glue was not properly handled as it was not suspending generic part of ohci controller. Alan Stern suggested, properly handle ohci-exynos suspend scenario. Calling explicitly the ohci_suspend() routine in exynos_ohci_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Signed-off-by: Manjunath Goudar Cc: Alan Stern Cc: Bartlomiej Zolnierkiewicz Cc: Arnd Bergmann Cc: Greg KH Cc: linux-usb@vger.kernel.org --- drivers/usb/host/ohci-exynos.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 3e4bc74..47e9c38 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -206,21 +206,11 @@ static int exynos_ohci_suspend(struct device *dev) unsigned long flags; int rc = 0; - /* - * Root hub was already suspended. Disable irq emission and - * mark HW unaccessible, bail out if RH has been resumed. Use - * the spinlock to properly synchronize with possible pending - * RH suspend or resume activity. - */ - spin_lock_irqsave(&ohci->lock, flags); - if (ohci->rh_state != OHCI_RH_SUSPENDED && - ohci->rh_state != OHCI_RH_HALTED) { - rc = -EINVAL; - goto fail; - } - - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + rc = ohci_suspend(hcd); + if (rc) + return rc; + spin_lock_irqsave(&ohci->lock, flags); if (exynos_ohci->otg) exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); @@ -228,7 +218,6 @@ static int exynos_ohci_suspend(struct device *dev) clk_disable_unprepare(exynos_ohci->clk); -fail: spin_unlock_irqrestore(&ohci->lock, flags); return rc;