From patchwork Thu Jun 13 09:16:20 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: 17878 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A982025BE0 for ; Thu, 13 Jun 2013 09:16:48 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 1sf11173697qee.6 for ; Thu, 13 Jun 2013 02:16:48 -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=xJU2xe46VExjTylC4Wb0Rl/V6xHR47eMOv9i6J4AgFc=; b=Ez9C0lAZpV5kd5lTCyebY/kHwwCb/4W5bWmeZpHquZqhVQwhQg3lTVtdmPACAYXMyk uq+qECeVdxRlWoIPQQMHfzCzEyjSLbC7YQeDn3ZirHBqZ1n9sAHN7Jzgbz+Kx/mCjRYg CWCFr27Zek6GzjLEk4ghoUbYXd3MSo4yA6gV89afZOEg9oTyW9jH31uKcg+FDraU54GV A2moB2uxexGAjSwJQ6z7sYyt6kNVG1tlgcQ1CYMhwAhljo4lQ1LV5KArAgcW4AChG0e5 DaRo+r8ztC1aDXkuBmC5Skurhp0nW/8Wg9Dl3N3dlhiUYIuwu83FUWe7+Xms745gjQ2D mYlw== X-Received: by 10.224.18.203 with SMTP id x11mr1167376qaa.2.1371115008468; Thu, 13 Jun 2013 02:16:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.38 with SMTP id or6ls2361981qeb.7.gmail; Thu, 13 Jun 2013 02:16:48 -0700 (PDT) X-Received: by 10.58.68.38 with SMTP id s6mr11097238vet.46.1371115008313; Thu, 13 Jun 2013 02:16:48 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id xb6si10099228vdb.68.2013.06.13.02.16.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:16:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 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.182; Received: by mail-vc0-f182.google.com with SMTP id id13so1934838vcb.13 for ; Thu, 13 Jun 2013 02:16:48 -0700 (PDT) X-Received: by 10.58.211.7 with SMTP id my7mr3659501vec.54.1371115008200; Thu, 13 Jun 2013 02:16:48 -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.191.99 with SMTP id gx3csp13722vec; Thu, 13 Jun 2013 02:16:47 -0700 (PDT) X-Received: by 10.68.103.194 with SMTP id fy2mr23613439pbb.158.1371115007047; Thu, 13 Jun 2013 02:16:47 -0700 (PDT) Received: from mail-pb0-x22f.google.com (mail-pb0-x22f.google.com [2607:f8b0:400e:c01::22f]) by mx.google.com with ESMTPS id tq5si13468865pab.233.2013.06.13.02.16.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:16:47 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22f is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::22f; Received: by mail-pb0-f47.google.com with SMTP id rr13so7487374pbb.20 for ; Thu, 13 Jun 2013 02:16:46 -0700 (PDT) X-Received: by 10.68.125.227 with SMTP id mt3mr24226679pbb.153.1371115006651; Thu, 13 Jun 2013 02:16:46 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id dc3sm22602113pbc.9.2013.06.13.02.16.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:16:46 -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-dev@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH V2 01/10] USB: OHCI: Properly handle ohci-at91 suspend Date: Thu, 13 Jun 2013 14:46:20 +0530 Message-Id: <1371114989-2342-2-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371114989-2342-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371114989-2342-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQn/WtUiSG4h4BYVeZSlRhiV8jvJyp8QDCTIRvnEcSeYNhuruA8JHl2Ee00gt6nKxDAMOejx X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 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. V2: -Incase ohci_suspend() fails, return right away without executing further. Signed-off-by: Manjunath Goudar Cc: Arnd Bergmann Cc: Alan Stern Cc: Greg KH Cc: linux-usb@vger.kernel.org Acked-by: Alan Stern Acked-by: Alan Stern --- drivers/usb/host/ohci-at91.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index fb2f127..6620e3a 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -619,8 +619,18 @@ 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 == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) { + ohci_resume(hcd, false); + ret = -EBUSY; + } + if (ret) + return ret; + + if (do_wakeup) enable_irq_wake(hcd->irq); /* @@ -637,7 +647,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)