From patchwork Tue Jun 25 06:39:37 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: 18090 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f200.google.com (mail-gh0-f200.google.com [209.85.160.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8F0C125D00 for ; Tue, 25 Jun 2013 06:40:21 +0000 (UTC) Received: by mail-gh0-f200.google.com with SMTP id 10sf12537701ghy.7 for ; Mon, 24 Jun 2013 23:40:21 -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=rirjmu97YYPxqaR9zF6jSo5gU7KyluzaGL3V5nbDUlE=; b=Sqekt4PECYRqOU8iRPpbnRaHoGQ9CUrLa6/D5L7x9mTnI7oMewKiRt2voIF55cAuFS bI7Z0uu/lOJUH5ooLKcj2+JgoPZdhk4pkAdSKU1leRk6n2iflTxZ+XHbFMfcXXWtYAP8 xA+XfaXyAzesYNFf5Lz8v9UjKhfk5a/LgtmkYhNFNLPscRjCoLHYAtTBMiSCRk4HYsGz cnNBSdtIlYFGvWtE3slFOP6uUJHIpi8hrhFPtLW3xXs8/Aw1Ml2MyDYdTYNqb31AuwwR cd02eKPvKbhO2xAD0YU+m+qoeVJWE9KxhMU2pjbpFfuqYad68Tb7qErJdaDUHyOSDFWM 8OlA== X-Received: by 10.224.57.65 with SMTP id b1mr28897391qah.2.1372142421308; Mon, 24 Jun 2013 23:40:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.66 with SMTP id 2ls835549qec.47.gmail; Mon, 24 Jun 2013 23:40:21 -0700 (PDT) X-Received: by 10.221.24.75 with SMTP id rd11mr13235734vcb.81.1372142421081; Mon, 24 Jun 2013 23:40:21 -0700 (PDT) Received: from mail-ve0-x22b.google.com (mail-ve0-x22b.google.com [2607:f8b0:400c:c01::22b]) by mx.google.com with ESMTPS id gr9si5875102vec.111.2013.06.24.23.40.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:21 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22b 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::22b; Received: by mail-ve0-f171.google.com with SMTP id b10so9737009vea.16 for ; Mon, 24 Jun 2013 23:40:21 -0700 (PDT) X-Received: by 10.220.53.7 with SMTP id k7mr12918552vcg.52.1372142421002; Mon, 24 Jun 2013 23:40: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 yu8csp55557veb; Mon, 24 Jun 2013 23:40:20 -0700 (PDT) X-Received: by 10.66.164.232 with SMTP id yt8mr30758075pab.21.1372142419751; Mon, 24 Jun 2013 23:40:19 -0700 (PDT) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [2607:f8b0:400e:c03::22c]) by mx.google.com with ESMTPS id ta8si10889277pac.218.2013.06.24.23.40.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:19 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22c is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::22c; Received: by mail-pa0-f44.google.com with SMTP id lj1so12185257pab.17 for ; Mon, 24 Jun 2013 23:40:19 -0700 (PDT) X-Received: by 10.68.11.71 with SMTP id o7mr27300969pbb.102.1372142419277; Mon, 24 Jun 2013 23:40:19 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id mr3sm6037160pbb.27.2013.06.24.23.40.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:18 -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 02/11] USB: OHCI: Properly handle ohci-at91 suspend Date: Tue, 25 Jun 2013 12:09:37 +0530 Message-Id: <1372142386-10691-3-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmZWw/FPCKIMcSubnpram4ZxfK0D2xUT8+V2xgn3q564LfnDDVvUhImbOczxzkpiY35Yfv2 X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22b 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-at91 glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_hcd_at91_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: - No change. --- drivers/usb/host/ohci-at91.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 4c01759..09f17d1 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -618,8 +618,14 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) { 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 (device_may_wakeup(&pdev->dev)) + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + + if (do_wakeup) enable_irq_wake(hcd->irq); /* @@ -640,7 +646,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) at91_stop_clock(); } - return 0; + return ret; } static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)