From patchwork Wed Jun 19 12:12:10 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: 17987 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5E4CA2397B for ; Wed, 19 Jun 2013 12:13:01 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id f14sf867901qak.3 for ; Wed, 19 Jun 2013 05:13:01 -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=igVLJKyEo/aVWluR5rSco5H0MMuC4AjarqxBKLv0gy4=; b=jV6aD+VJ5fqJO5+SmbMItxAWc+WeCgEhjzTmtXyd8oTf7Kd5ZVsFho/VlvkXqZEoRE KS7K3rpNdxe39iEgSwOman0Pnd7CkhpFdQCyQ0W1gEKxayhYSDhiTd8h54eV+9jdRQ1w n5rL0zq/8lwTzpGWyeIZEwSecsMLwyf1pqNhizdWymytI1wPhN2zQnhLGqvfxwR38hBW lqI1GHyhai85LXVDV7a6LqRN//PEAccD8xMTgn4lM525RF8YfszYQSxDW40+pG+WpwE/ blzycDCUHiJG1VpwUSIrcAt8hDyWfMqa30NvYiN9GUC0glud919seSUqa8LIr89cdjov KSEg== X-Received: by 10.58.252.101 with SMTP id zr5mr281199vec.40.1371643981124; Wed, 19 Jun 2013 05:13:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.67 with SMTP id ks3ls244574qeb.57.gmail; Wed, 19 Jun 2013 05:13:00 -0700 (PDT) X-Received: by 10.58.255.199 with SMTP id as7mr863446ved.23.1371643980900; Wed, 19 Jun 2013 05:13:00 -0700 (PDT) Received: from mail-vb0-x233.google.com (mail-vb0-x233.google.com [2607:f8b0:400c:c02::233]) by mx.google.com with ESMTPS id sc6si6458325vdc.8.2013.06.19.05.13.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:00 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::233 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::233; Received: by mail-vb0-f51.google.com with SMTP id x17so3611845vbf.24 for ; Wed, 19 Jun 2013 05:13:00 -0700 (PDT) X-Received: by 10.220.67.10 with SMTP id p10mr519737vci.85.1371643980787; Wed, 19 Jun 2013 05:13:00 -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 yu8csp106222veb; Wed, 19 Jun 2013 05:13:00 -0700 (PDT) X-Received: by 10.66.228.34 with SMTP id sf2mr6566126pac.134.1371643979638; Wed, 19 Jun 2013 05:12:59 -0700 (PDT) Received: from mail-pb0-x236.google.com (mail-pb0-x236.google.com [2607:f8b0:400e:c01::236]) by mx.google.com with ESMTPS id eh5si10727977pac.347.2013.06.19.05.12.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:59 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::236 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::236; Received: by mail-pb0-f54.google.com with SMTP id ro2so4979121pbb.41 for ; Wed, 19 Jun 2013 05:12:59 -0700 (PDT) X-Received: by 10.68.213.231 with SMTP id nv7mr2596067pbc.70.1371643979270; Wed, 19 Jun 2013 05:12:59 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id e2sm22925142pbc.23.2013.06.19.05.12.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:58 -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 V3 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Date: Wed, 19 Jun 2013 17:42:10 +0530 Message-Id: <1371643936-3314-6-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmsNk2+F55ORCFsdPRmbdkml9C+zDcOR7JbyzRHE95s2YbFW91Cq9ERwdiO/2r25xboJDiz X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::233 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-ep93xx glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_hcd_ep93xx_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: -Aligned variable "do_wakeup" and "ret". --- drivers/usb/host/ohci-ep93xx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index 8704e9f..f5f11d1 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c @@ -174,13 +174,21 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_ { 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); + + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + ohci->next_statechange = jiffies; ep93xx_stop_hc(&pdev->dev); - return 0; + + return ret; } static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)