From patchwork Wed Jun 19 12:12:07 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: 17984 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BC4452397B for ; Wed, 19 Jun 2013 12:12:46 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cr7sf869725qab.1 for ; Wed, 19 Jun 2013 05:12:46 -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=fXYmCDqiSQ9bEX6mQ5AWs7nSd7MNDTPzbB/F1Fp5do0=; b=pBYgGB0hAVoAH50Xb9GjwFmRp3MD3XK18vAZ+0bVNXLfTkoP9GCLZSHnKwieL8BEbN klNm84cygHAyhKUg4/TzrDmw7D2IaaDs66s/uB2ZuKuoqtN2e80GM5fpUfd9/iRVztVs h/qiYwAYgE1pDDqJBB0fWRn9HLvGvA/EVvF2YxOnj7jzpQm1iJ345gV7+DifuxjmTw4X gtZmafO1yfqh8GUZF8limvQBVQMdYVHbFQjoEtSx0bzHPBgeWBMMCihyld2K7rkUMeo1 jmZgObmIInxgabMN8Z4wKH48Ne6B2mhUvSCLkxKd/YlpEulZV0uDTen44tutOvlNoU6+ LnmQ== X-Received: by 10.224.205.138 with SMTP id fq10mr3252039qab.1.1371643966433; Wed, 19 Jun 2013 05:12:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.112 with SMTP id gd16ls257878qeb.68.gmail; Wed, 19 Jun 2013 05:12:46 -0700 (PDT) X-Received: by 10.58.200.73 with SMTP id jq9mr827719vec.53.1371643966267; Wed, 19 Jun 2013 05:12:46 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id zt2si6439513vdb.89.2013.06.19.05.12.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf11so3743000vcb.12 for ; Wed, 19 Jun 2013 05:12:46 -0700 (PDT) X-Received: by 10.58.45.70 with SMTP id k6mr887629vem.9.1371643966142; Wed, 19 Jun 2013 05:12:46 -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 yu8csp106213veb; Wed, 19 Jun 2013 05:12:45 -0700 (PDT) X-Received: by 10.66.155.39 with SMTP id vt7mr6376173pab.99.1371643963885; Wed, 19 Jun 2013 05:12:43 -0700 (PDT) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [2607:f8b0:400e:c03::235]) by mx.google.com with ESMTPS id y9si6844213pay.25.2013.06.19.05.12.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:43 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::235 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::235; Received: by mail-pa0-f53.google.com with SMTP id tj12so5066264pac.26 for ; Wed, 19 Jun 2013 05:12:43 -0700 (PDT) X-Received: by 10.68.184.100 with SMTP id et4mr2529037pbc.48.1371643963437; Wed, 19 Jun 2013 05:12:43 -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.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:42 -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 02/11] USB: OHCI: Properly handle ohci-at91 suspend Date: Wed, 19 Jun 2013 17:42:07 +0530 Message-Id: <1371643936-3314-3-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: ALoCoQm52dAsRhwok6pfYUWjhfxZRsQwftLCNKBkJrQKt5tleofXyD6ZUO+aX3WWF7iRnw353jwS X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 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". --- 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 fb2f127..e34baa6 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -619,8 +619,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); /* @@ -637,7 +643,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)