From patchwork Thu Jun 20 09:35:59 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: 18006 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 124812393D for ; Thu, 20 Jun 2013 09:37:43 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id a12sf5857167wgh.9 for ; Thu, 20 Jun 2013 02:37:43 -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=UTfIlaZEc1Eswj3CPoS1o6A4z4k5u/MaWC6FlaA7Sng=; b=NjgDTdWhItraZtyKVpz52fH9o6Jh84WNLliiFtDulz7cT6CiF8a4lanRZSrclHUFH8 MFEdhbC8pRePIWQQ01HHDvNTk2q5RylAZfm7WZmTvCmQf9tYgPCedOzT92U55fMgusCJ R09HJfdvkvC43hLS1hq5NYo2xth6WsL4lVLK/sCOZc/PKR1c/W3shjeTf83sLhw/9AJK PEDgV9MqDqbU4mLH4zh5ZByJcFbfk5+Nj36rzXfe4YlfNOr6NiHSSSkcGHCacddRIlT3 ifRUnLNP+NZpHhAkh1HkiJ4ODSrS1R/4bM+SNzHdAYIeW/UtuA7XdZ2KmJTvTeJFC+Rw HrZQ== X-Received: by 10.180.11.239 with SMTP id t15mr7824650wib.3.1371721063256; Thu, 20 Jun 2013 02:37:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.35.38 with SMTP id e6ls97195wij.9.canary; Thu, 20 Jun 2013 02:37:43 -0700 (PDT) X-Received: by 10.180.14.2 with SMTP id l2mr13645900wic.48.1371721063061; Thu, 20 Jun 2013 02:37:43 -0700 (PDT) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [2607:f8b0:400c:c01::232]) by mx.google.com with ESMTPS id r12si4395444wik.18.2013.06.20.02.37.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:37:43 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::232 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:c01::232; Received: by mail-ve0-f178.google.com with SMTP id pb11so4854671veb.37 for ; Thu, 20 Jun 2013 02:37:42 -0700 (PDT) X-Received: by 10.220.67.10 with SMTP id p10mr2231186vci.85.1371721061974; Thu, 20 Jun 2013 02:37:41 -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 yu8csp13815veb; Thu, 20 Jun 2013 02:37:41 -0700 (PDT) X-Received: by 10.66.102.97 with SMTP id fn1mr10640897pab.116.1371721060951; Thu, 20 Jun 2013 02:37:40 -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 v10si37283pav.155.2013.06.20.02.37.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:37:40 -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 rp16so6056774pbb.14 for ; Thu, 20 Jun 2013 02:37:40 -0700 (PDT) X-Received: by 10.68.96.193 with SMTP id du1mr6725844pbb.142.1371721060372; Thu, 20 Jun 2013 02:37:40 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.192]) by mx.google.com with ESMTPSA id kq2sm35530pab.19.2013.06.20.02.36.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:37:39 -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 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Date: Thu, 20 Jun 2013 15:05:59 +0530 Message-Id: <1371720968-7533-4-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmz2DOBnwfsWpPxT3SZQmOVxjwafVnWrU6EQLMtPTs7tVDdb6PjGTtzEt/E+piFB4K4HZFs X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::232 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-s3c2410 glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_hcd_s3c2410_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: -rid of unwanted code from ohci_hcd_s3c2410_drv_suspend() which already ohci_suspend() does it. V4: -The do_wakeup variable alignment is removed. --- drivers/usb/host/ohci-s3c2410.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 8018bb1..4ccf156 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -428,26 +428,15 @@ static int ohci_hcd_s3c2410_drv_suspend(struct device *dev) struct usb_hcd *hcd = dev_get_drvdata(dev); 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) { - rc = -EINVAL; - goto bail; - } - - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + rc = ohci_suspend(hcd, do_wakeup); + if (rc) + return rc; s3c2410_stop_hc(pdev); -bail: - spin_unlock_irqrestore(&ohci->lock, flags); return rc; }