From patchwork Thu Jul 25 10:53:56 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: 18565 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C118C25DF6 for ; Thu, 25 Jul 2013 10:54:38 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 2sf517845qea.5 for ; Thu, 25 Jul 2013 03:54:38 -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=6SbpfgSwxZlGRIUlJhfbS6wayfMV4N+fA5pqg2s58D0=; b=icK7jILhRZjl0SoJI45ZXn+WcxVEb9qQqUBBts4FoiQ2k2Y8K/+FXAqt2zrvLZBpWW z5RiLCyBxaX7ylrPS/6Z8IBra/IYiby/DwokUb7egQ7Y6rZGQSAzpge9TbGyD8bkcpP+ Ek3BTqQqrAoIK2teJNc3OKhm3umHWCJD+xZDCZftjh7EDoTu7PyM30nzDGL0YVgYB6ID po0ZrRO9iC5vAPchmG2oVcgoEybMkxgv+ubGv4EcRGBi8/ZaV+g9MRsI9njeA3DtaHPj RyDP9sXQtXj90CCUEo0rGm/iHpeqDJnrctdVSb71vGGWnJZ3oMzLtHc8rxJzP2NbXmc0 54Zw== X-Received: by 10.224.7.7 with SMTP id b7mr3739200qab.5.1374749678576; Thu, 25 Jul 2013 03:54:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.98 with SMTP id n2ls592994qed.22.gmail; Thu, 25 Jul 2013 03:54:38 -0700 (PDT) X-Received: by 10.58.227.198 with SMTP id sc6mr17480705vec.59.1374749678467; Thu, 25 Jul 2013 03:54:38 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id aw7si12166944vec.50.2013.07.25.03.54.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id da11so392036veb.34 for ; Thu, 25 Jul 2013 03:54:38 -0700 (PDT) X-Received: by 10.52.35.109 with SMTP id g13mr14661522vdj.21.1374749678373; Thu, 25 Jul 2013 03:54:38 -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 yu8csp71164veb; Thu, 25 Jul 2013 03:54:37 -0700 (PDT) X-Received: by 10.68.217.7 with SMTP id ou7mr3127487pbc.8.1374749677398; Thu, 25 Jul 2013 03:54:37 -0700 (PDT) Received: from mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) by mx.google.com with ESMTPS id pt17si6875660pab.35.2013.07.25.03.54.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.42 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.160.42; Received: by mail-pb0-f42.google.com with SMTP id un1so614562pbc.1 for ; Thu, 25 Jul 2013 03:54:37 -0700 (PDT) X-Received: by 10.66.50.104 with SMTP id b8mr48950311pao.39.1374749676983; Thu, 25 Jul 2013 03:54:36 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:36 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 07/11] USB: OHCI: Properly handle ohci-omap suspend Date: Thu, 25 Jul 2013 16:23:56 +0530 Message-Id: <1374749640-30062-8-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> References: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmcJ5Qb08VXKQoaV2yk08HKuikNMgEICwKl9hXhMCROc631mITjuY6qaSnVyTZX2CyxD3Zb X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 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 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: -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 8149ef0..d13fb4f 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -431,16 +431,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)