From patchwork Thu Jul 25 10:54:00 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: 18569 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 8552725DF6 for ; Thu, 25 Jul 2013 10:54:50 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf1446568ghb.2 for ; Thu, 25 Jul 2013 03:54:50 -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=2Ktvla48lTvqqRrILp74RXbjvblOz5rgOQATC3fGbCM=; b=dd0s9eseZHsUnCbmrf1D0Dzj5g/ehTH64mtV3aGlJO2hiNHFKMVBk1SpbYvdNCj1Qj jrn7tujC2XFA8Qb50xcLiRv8925wqR63yEdfsdmFHDc7etAzqTCRRr9YnJWAyO2iCbS+ t87s/e4l+pYUX9nRbnDM7/tOiFrqjuWPX8zB7Rjxc8pT1EPRTR1h8iyjD4a7YuAy8gyN u79AJyz70AE96egDu183+0NFf73LRyFyTaosbhi5hzM66fP8B79PPAjXqQ34CR8jotT6 Ms68eOhRdkPEgMqjJRQbpAITCahRWqaIGg2XpT1Pz2OIxPnFKA5v2jXN/4buLx6RK5L1 z8Sg== X-Received: by 10.236.116.169 with SMTP id g29mr23265828yhh.6.1374749690289; Thu, 25 Jul 2013 03:54:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.72.233 with SMTP id g9ls595096qev.84.gmail; Thu, 25 Jul 2013 03:54:50 -0700 (PDT) X-Received: by 10.58.243.2 with SMTP id wu2mr17495059vec.74.1374749690159; Thu, 25 Jul 2013 03:54:50 -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 xb6si12159688vdb.107.2013.07.25.03.54.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:50 -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 da11so392113veb.34 for ; Thu, 25 Jul 2013 03:54:50 -0700 (PDT) X-Received: by 10.58.2.137 with SMTP id 9mr17717385veu.50.1374749690076; Thu, 25 Jul 2013 03:54:50 -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 yu8csp71178veb; Thu, 25 Jul 2013 03:54:49 -0700 (PDT) X-Received: by 10.66.169.172 with SMTP id af12mr26686367pac.23.1374749689006; Thu, 25 Jul 2013 03:54:49 -0700 (PDT) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by mx.google.com with ESMTPS id sr9si30946261pab.67.2013.07.25.03.54.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.49 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.160.49; Received: by mail-pb0-f49.google.com with SMTP id jt11so602172pbb.36 for ; Thu, 25 Jul 2013 03:54:48 -0700 (PDT) X-Received: by 10.68.106.67 with SMTP id gs3mr47377782pbb.126.1374749688513; Thu, 25 Jul 2013 03:54:48 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:47 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 11/11] USB: OHCI: Properly handle ohci-spear suspend Date: Thu, 25 Jul 2013 16:24:00 +0530 Message-Id: <1374749640-30062-12-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: ALoCoQnghsV0CotXe9wyMpOFTYCttB5+M75vBLUuvz0YMtgYuGrxUmxEtkw5zAhXcTHRVU/cpNgi 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-spear glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in spear_ohci_hcd_drv_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-spear.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 31ff3fc..41148f8 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c @@ -130,20 +130,26 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev) } #if defined(CONFIG_PM) -static int spear_ohci_hcd_drv_suspend(struct platform_device *dev, +static int spear_ohci_hcd_drv_suspend(struct platform_device *pdev, pm_message_t message) { - struct usb_hcd *hcd = platform_get_drvdata(dev); + struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct spear_ohci *sohci_p = to_spear_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; + clk_disable_unprepare(sohci_p->clk); - return 0; + return ret; } static int spear_ohci_hcd_drv_resume(struct platform_device *dev)