From patchwork Mon Jul 22 09:32: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: 18470 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E1DE925E1F for ; Mon, 22 Jul 2013 09:33:10 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id ox1sf9030408veb.6 for ; Mon, 22 Jul 2013 02:33:10 -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=Rupa3nPABIo/iG43r5OpAHU6BNX/TALg2xmbU5OERls=; b=hrZEKaRWa+scyx1dfAJOe/O9WDyipGdSMJfehBZSEDQLWuQ8DUGRJcEK2rWhZcGiEM 3JZ+OfGCp7U+2tZ4z7NXJQMg1tYSKISzg7/vYpawg54RBv0WoAiSHAMTsWUrhuelyYrD lfiHmpv238+mdF4O82kc/1tuTJsUUxrTSvdqYMoL7GYR/dpJI4QdFJFWEloVuRlcaBcn nncwT2eEabbHtJ6HqBf5KDgDjF/j586BEnf+k2vUWoO1mqjBfg7/WnEqUrUJz319GwVa 5AcrDcjtJgbpo7pO7f5hlhez3Dzrg1sNUeJTkIogGRfXdhfD7bZIIMwpPAkwt6bX04ya CBBw== X-Received: by 10.236.119.227 with SMTP id n63mr15641442yhh.38.1374485590534; Mon, 22 Jul 2013 02:33:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.50.228 with SMTP id f4ls2618050qeo.29.gmail; Mon, 22 Jul 2013 02:33:10 -0700 (PDT) X-Received: by 10.220.42.84 with SMTP id r20mr9069491vce.87.1374485590432; Mon, 22 Jul 2013 02:33:10 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id k17si3344826vck.27.2013.07.22.02.33.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id jw11so4844014veb.4 for ; Mon, 22 Jul 2013 02:33:10 -0700 (PDT) X-Received: by 10.52.27.172 with SMTP id u12mr7507387vdg.64.1374485590353; Mon, 22 Jul 2013 02:33:10 -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 yu8csp46430veb; Mon, 22 Jul 2013 02:33:09 -0700 (PDT) X-Received: by 10.66.253.4 with SMTP id zw4mr15937614pac.119.1374485589101; Mon, 22 Jul 2013 02:33:09 -0700 (PDT) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id ap1si19221660pad.335.2013.07.22.02.33.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.174 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id 10so6626937pdc.19 for ; Mon, 22 Jul 2013 02:33:08 -0700 (PDT) X-Received: by 10.66.117.167 with SMTP id kf7mr28100830pab.73.1374485588712; Mon, 22 Jul 2013 02:33:08 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.229]) by mx.google.com with ESMTPSA id bb1sm24977759pbc.10.2013.07.22.02.33.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:08 -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 02/11] USB: OHCI: Properly handle ohci-at91 suspend Date: Mon, 22 Jul 2013 15:02:37 +0530 Message-Id: <1374485566-3997-3-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQl91koX5W4aMbqqNuJ4vWSJ4Mfp3tU/mxu8F8JObW+EUJY1wYTRXN7OyaRFhpkl3ZT7XwSq X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 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 08e28eb..008645c 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)