From patchwork Tue Jun 25 06:39:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjunath.goudar@linaro.org X-Patchwork-Id: 18094 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D131225D00 for ; Tue, 25 Jun 2013 06:40:42 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf12538766ghb.2 for ; Mon, 24 Jun 2013 23:40:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=OnD3smpd+tVXBGYBuP1MxukA9TaVKVhSsIXh2u4SF6M=; b=SiVjBRgZ1Ic7aqabWWlTor9QTNGI+v+Sy6E8rHE/UdWVnx13GNia0VNdi7s8evSuws U7A1QcdF/zro23x4v+avhnybSh8Zu87xq3ol9DVGUYwWJiBrqPY6MNO2weezDtZdVlUZ Cdxg0vsgtE8PQWgizhM9L9z6HHcH7R2fGtIoYncQtY82w640dhDv3J1ISY+lOXCgbJ8n kpFL50NeaZpY4WdW/EqLpcZ51zBwS0hoIFarTlCYd0ZMgupmEKYDXm7Vw/fiLGc+iEc2 euFEZ3kxaC4zrOSHnLgs+EAdvOxApmCfdiV4vLXd0Novxyaz55lQwIlY2eMoPyVW3TSC kULQ== X-Received: by 10.236.78.198 with SMTP id g46mr15590862yhe.56.1372142442652; Mon, 24 Jun 2013 23:40:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.210 with SMTP id x18ls2384207qeu.85.gmail; Mon, 24 Jun 2013 23:40:42 -0700 (PDT) X-Received: by 10.52.244.1 with SMTP id xc1mr11212151vdc.31.1372142442457; Mon, 24 Jun 2013 23:40:42 -0700 (PDT) Received: from mail-vb0-x231.google.com (mail-vb0-x231.google.com [2607:f8b0:400c:c02::231]) by mx.google.com with ESMTPS id y14si5878645vcn.84.2013.06.24.23.40.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:42 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::231; Received: by mail-vb0-f49.google.com with SMTP id 12so8943102vbf.22 for ; Mon, 24 Jun 2013 23:40:42 -0700 (PDT) X-Received: by 10.220.67.10 with SMTP id p10mr12971231vci.85.1372142442357; Mon, 24 Jun 2013 23:40:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp55569veb; Mon, 24 Jun 2013 23:40:41 -0700 (PDT) X-Received: by 10.66.163.130 with SMTP id yi2mr15595329pab.7.1372142441312; Mon, 24 Jun 2013 23:40:41 -0700 (PDT) Received: from mail-pb0-x229.google.com (mail-pb0-x229.google.com [2607:f8b0:400e:c01::229]) by mx.google.com with ESMTPS id ta8si10905391pac.131.2013.06.24.23.40.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:41 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::229 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::229; Received: by mail-pb0-f41.google.com with SMTP id rp16so12222364pbb.28 for ; Mon, 24 Jun 2013 23:40:41 -0700 (PDT) X-Received: by 10.66.26.20 with SMTP id h20mr30162897pag.180.1372142440893; Mon, 24 Jun 2013 23:40:40 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id mr3sm6037160pbb.27.2013.06.24.23.40.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:40 -0700 (PDT) From: Manjunath Goudar To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, stern@rowland.harvard.edu, arnd@linaro.org, manjunath.goudar@linaro.org, linaro-kernel@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH V4 06/11] USB: OHCI: Properly handle ohci-exynos suspend Date: Tue, 25 Jun 2013 12:09:41 +0530 Message-Id: <1372142386-10691-7-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmCuQeWgZ8OdcljBEuPUNtUyB9l1r3Ynb0aPt4SpoEGrfqFfFKDgfiIKFAqv9l30uVW4AjK X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Suspend scenario in case of ohci-exynos glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in exynos_ohci_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Acked-by: Alan Stern Cc: Arnd Bergmann Cc: Greg KH Cc: linux-usb@vger.kernel.org V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -rid of unwanted code from ohci_hcd_s3c2410_drv_suspend() which already ohci_suspend() does it. -Aligned variable "do_wakeup" and "ret". V4: -The do_wakeup and rc variable alignment is removed. --- drivers/usb/host/ohci-exynos.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index ae6068d..17de3dd 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -203,24 +203,15 @@ static int exynos_ohci_suspend(struct device *dev) struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct platform_device *pdev = to_platform_device(dev); + bool do_wakeup = device_may_wakeup(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, do_wakeup); + 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 +219,6 @@ static int exynos_ohci_suspend(struct device *dev) clk_disable_unprepare(exynos_ohci->clk); -fail: spin_unlock_irqrestore(&ohci->lock, flags); return rc;