From patchwork Thu Jun 20 09:35:58 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: 18005 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 827932393D for ; Thu, 20 Jun 2013 09:36:53 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id c50sf5811600eek.0 for ; Thu, 20 Jun 2013 02:36:52 -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=A4wAeOpYEg5pe0isRV3TTuYskVKhc2EBXyE1k+6olz4=; b=cxT58fPgrcLz+5UzXOp0HHooRvMMbMMFdLinLvgGZtxNYwH6HLowCdPVvbXMAMcY9J a81JqN5Ku+93TLAR6wV04sAqtM2Jgpd18sjI1/+qcly64YIW0wYDmpxVAcB4JUNXa5MI BFB94DozGQZH4+T8Tiog0HOGamp0jY7NtVUK6ftCNLtz8LN8rn/rQJ1LrvXxGTdob9Sz xNerYbnh9hBzaMvDC5xYG8mrGgm+7pWirh65jWdo/QIX2NAftzhnOXN2fZdYsrmxg7ws qwwWl5YRiNPNTFFjiOwIsWw1Hz63BzrLQLwSMCrf5Ucqi3ZFfBf15DDFjPrW9YGABBcC Aifw== X-Received: by 10.180.12.200 with SMTP id a8mr7812990wic.1.1371721012598; Thu, 20 Jun 2013 02:36:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.98.233 with SMTP id el9ls90941wib.40.canary; Thu, 20 Jun 2013 02:36:52 -0700 (PDT) X-Received: by 10.194.239.225 with SMTP id vv1mr5039224wjc.63.1371721012497; Thu, 20 Jun 2013 02:36:52 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id xn20si4392620wib.23.2013.06.20.02.36.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:36:52 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f 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::22f; Received: by mail-ve0-f175.google.com with SMTP id da11so4802883veb.20 for ; Thu, 20 Jun 2013 02:36:51 -0700 (PDT) X-Received: by 10.52.22.174 with SMTP id e14mr2174181vdf.21.1371721011408; Thu, 20 Jun 2013 02:36:51 -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 yu8csp13797veb; Thu, 20 Jun 2013 02:36:50 -0700 (PDT) X-Received: by 10.66.189.130 with SMTP id gi2mr10688726pac.89.1371721010281; Thu, 20 Jun 2013 02:36:50 -0700 (PDT) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [2607:f8b0:400e:c03::22a]) by mx.google.com with ESMTPS id o4si14144pac.279.2013.06.20.02.36.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:36:50 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22a is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::22a; Received: by mail-pa0-f42.google.com with SMTP id rl6so6137394pac.1 for ; Thu, 20 Jun 2013 02:36:49 -0700 (PDT) X-Received: by 10.68.180.4 with SMTP id dk4mr6653382pbc.104.1371721009904; Thu, 20 Jun 2013 02:36:49 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.192]) by mx.google.com with ESMTPSA id kq2sm35530pab.19.2013.06.20.02.36.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:36:49 -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: Thu, 20 Jun 2013 15:05:58 +0530 Message-Id: <1371720968-7533-3-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: ALoCoQnOzhk8AZGCjYW1U+d3CN3ZxAJeVqndP74EBCqdZvsYcKzEWsDqw7U8Qt6ATPdhww8LM9CC X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f 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 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)