From patchwork Thu Jun 20 09:36:01 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: 18008 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0F6C62393D for ; Thu, 20 Jun 2013 09:38:09 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id c50sf5812825eek.0 for ; Thu, 20 Jun 2013 02:38:09 -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=xE2vuWjqPzAnB6+HrO0gIKm5gMaQvS17XdTiPk26e8Y=; b=oBD5/hB1wiZK4jEg++aWgaXWoLQ0k0xanYFffzBEtlhAqnbwOyy0eNM2xRSNXDc6Th naXi4q7W9AGk47pBUFQRsckobQnZynGHjOH9u+1MlVAnmRk0Z9SnpORC/VcYf2+n58pi jlSXl2ylGO1BJCGsESfgrPFjPK0y/Ma7mZKFIEn9Xa7aXX1RSpz+5ch/I4ah0MCGlkwc 6TezXhSz8M/Ri7Rn+J9VwHQbrZOtNXgo5QbNn7kSdkss7RcxGqi6eG08L4aQIezY4+fK rNYav9ST5K8b+RuKV+YP8Q+3sXyc3Ujsb3wkLuGB3zxQpB5/84KpiRHE0mBopD4qQrCD 0gWQ== X-Received: by 10.181.11.130 with SMTP id ei2mr5013843wid.7.1371721089060; Thu, 20 Jun 2013 02:38:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.97.10 with SMTP id dw10ls91519wib.8.canary; Thu, 20 Jun 2013 02:38:08 -0700 (PDT) X-Received: by 10.180.206.70 with SMTP id lm6mr13910186wic.50.1371721088873; Thu, 20 Jun 2013 02:38:08 -0700 (PDT) Received: from mail-ve0-x234.google.com (mail-ve0-x234.google.com [2607:f8b0:400c:c01::234]) by mx.google.com with ESMTPS id x8si4377402wie.72.2013.06.20.02.38.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:08 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::234 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::234; Received: by mail-ve0-f180.google.com with SMTP id pa12so4903949veb.11 for ; Thu, 20 Jun 2013 02:38:07 -0700 (PDT) X-Received: by 10.52.22.174 with SMTP id e14mr2176035vdf.21.1371721087802; Thu, 20 Jun 2013 02:38:07 -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 yu8csp13834veb; Thu, 20 Jun 2013 02:38:07 -0700 (PDT) X-Received: by 10.66.8.138 with SMTP id r10mr10652437paa.55.1371721086795; Thu, 20 Jun 2013 02:38:06 -0700 (PDT) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx.google.com with ESMTPS id y9si35821pay.170.2013.06.20.02.38.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.182 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.182; Received: by mail-pd0-f182.google.com with SMTP id r10so6053508pdi.13 for ; Thu, 20 Jun 2013 02:38:06 -0700 (PDT) X-Received: by 10.68.179.99 with SMTP id df3mr6471217pbc.198.1371721086413; Thu, 20 Jun 2013 02:38:06 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.192]) by mx.google.com with ESMTPSA id kq2sm35530pab.19.2013.06.20.02.37.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:05 -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 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Date: Thu, 20 Jun 2013 15:06:01 +0530 Message-Id: <1371720968-7533-6-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: ALoCoQmmO4Q213acwz+h0uXACE50UNfgjWKzMMry34PymWVYdk2Ixs9VMzRgPWYPgZbSsiyDJ3Ak X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::234 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". V4: -The do_wakeup and ret variable alignment is removed. --- drivers/usb/host/ohci-ep93xx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index 8704e9f..f0aaa48 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c @@ -174,13 +174,20 @@ 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); ohci->next_statechange = jiffies; + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + ep93xx_stop_hc(&pdev->dev); - return 0; + + return ret; } static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)