From patchwork Thu Jun 20 09:36:03 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: 18010 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 76F3F2393D for ; Thu, 20 Jun 2013 09:38:22 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha12sf8394947vcb.8 for ; Thu, 20 Jun 2013 02:38:22 -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=oLSJsvujFkKB3bflWDsOow37+B5F4Yv346ZVGEWjldE=; b=ozn/DylZFzWC+h8rmL9qMQE0HH9Ei2vx0peppfOxQQyAeEAE8b4OTVo+vzB2aygki+ VWSHResHh7i2qVgIy4vuOCZGi6kb0/j9Pwq6yAmmb7Y/KcocBHzcKA5tAd8Map4B3HCR xY03FNQLI7YDi0WdAbBh+OUl/QR65Xm7cc+Xyf+AvRSsphU/DmKQ2euSntzbpcu4sUC2 K3eLrx/+zBiVHcI+QYNrlogp0lFC/CuDXsumIXJ/TmsOd8Cn+vEfrXRyVvPDh8RPdnIc h6lKrHT2HrxKrGYCszglsoOgLs/vpuUHUGkd6R41kAUVFlQzle/pcwZjIN+wtR1yYFAB f+bw== X-Received: by 10.236.127.108 with SMTP id c72mr3757029yhi.16.1371721102216; Thu, 20 Jun 2013 02:38:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.42.106 with SMTP id n10ls570149qel.90.gmail; Thu, 20 Jun 2013 02:38:22 -0700 (PDT) X-Received: by 10.58.255.199 with SMTP id as7mr2621859ved.23.1371721102051; Thu, 20 Jun 2013 02:38:22 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id p8si7634712vdv.57.2013.06.20.02.38.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id ht10so4578114vcb.18 for ; Thu, 20 Jun 2013 02:38:22 -0700 (PDT) X-Received: by 10.220.110.78 with SMTP id m14mr2271837vcp.53.1371721101949; Thu, 20 Jun 2013 02:38:21 -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 yu8csp13840veb; Thu, 20 Jun 2013 02:38:21 -0700 (PDT) X-Received: by 10.66.197.165 with SMTP id iv5mr10814590pac.67.1371721100830; Thu, 20 Jun 2013 02:38:20 -0700 (PDT) Received: from mail-pb0-x22c.google.com (mail-pb0-x22c.google.com [2607:f8b0:400e:c01::22c]) by mx.google.com with ESMTPS id px9si13091863pbb.335.2013.06.20.02.38.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:20 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22c is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::22c; Received: by mail-pb0-f44.google.com with SMTP id uo1so6065875pbc.3 for ; Thu, 20 Jun 2013 02:38:20 -0700 (PDT) X-Received: by 10.66.0.7 with SMTP id 7mr10435896paa.199.1371721100429; Thu, 20 Jun 2013 02:38:20 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.192]) by mx.google.com with ESMTPSA id kq2sm35530pab.19.2013.06.20.02.38.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:19 -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 07/11] USB: OHCI: Properly handle ohci-omap suspend Date: Thu, 20 Jun 2013 15:06:03 +0530 Message-Id: <1371720968-7533-8-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: ALoCoQmqWuVCx16DVYqdA5OYtbCuhmpxvQHWihW9ZluYYqUrryqd0CBhTPhVgGfu4Wl9CAAK4ntn X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 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-omap glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_omap_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: -Aligned variable "do_wakeup" and "ret". V4: -The do_wakeup and ret variable alignment is removed. --- drivers/usb/host/ohci-omap.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 10ba58d..baefc46 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -432,16 +432,23 @@ static int ohci_hcd_omap_drv_remove(struct platform_device *dev) #ifdef CONFIG_PM -static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message) +static int ohci_omap_suspend(struct platform_device *pdev, pm_message_t message) { - struct ohci_hcd *ohci = hcd_to_ohci(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; + omap_ohci_clock_power(0); - return 0; + return ret; } static int ohci_omap_resume(struct platform_device *dev)