From patchwork Thu Jun 13 09:10:52 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: 17868 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CFA6825BE0 for ; Thu, 13 Jun 2013 09:11:23 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 1sf5889255qec.3 for ; Thu, 13 Jun 2013 02:11:23 -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=RXelgweUftyVA1Y1uMtcPHRZ3gk540UB1M0z7Tc8Zu2gyKbR9NPhpZNesSRF4P8io6 2D5MAEXh6hKLTXCKqDRjF/DhHTszENkutmjLEIZ/6Ae6xK7jJnnSh0wkeyueWEh1sOvA Qwi5eaATiMlRvXbed0u3zi4K7x/mm4vJP4z7G3eb+yEWE8idxfiWEM/femreaCNbXGoo nu5bjw9ubPTy4SWjlUsbPCxAQNPYmxv0n3ZosUq2g/PB0Eo/ibDKHNDN9ddhj95uE+Qc l4WwX5TKVgLGCSyt/zTtF/rHf+ibTPyMpmCatMaN86BT9dBigO2A/0XdnHZjE8FUCm3A HUMQ== X-Received: by 10.224.205.138 with SMTP id fq10mr1161836qab.1.1371114683540; Thu, 13 Jun 2013 02:11:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.108.201 with SMTP id hm9ls4117514qeb.65.gmail; Thu, 13 Jun 2013 02:11:23 -0700 (PDT) X-Received: by 10.58.6.141 with SMTP id b13mr11157370vea.45.1371114683351; Thu, 13 Jun 2013 02:11:23 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id q5si10101805vcw.15.2013.06.13.02.11.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id hz11so3242032vcb.38 for ; Thu, 13 Jun 2013 02:11:22 -0700 (PDT) X-Received: by 10.58.22.74 with SMTP id b10mr11086159vef.47.1371114682916; Thu, 13 Jun 2013 02:11:22 -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 gx3csp13550vec; Thu, 13 Jun 2013 02:11:22 -0700 (PDT) X-Received: by 10.66.145.2 with SMTP id sq2mr1944388pab.2.1371114681969; Thu, 13 Jun 2013 02:11:21 -0700 (PDT) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx.google.com with ESMTPS id wf5si8016028pab.254.2013.06.13.02.11.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.173 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.173; Received: by mail-pd0-f173.google.com with SMTP id v14so7212897pde.4 for ; Thu, 13 Jun 2013 02:11:21 -0700 (PDT) X-Received: by 10.68.247.226 with SMTP id yh2mr22505343pbc.164.1371114681538; Thu, 13 Jun 2013 02:11:21 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id p2sm28451974pag.22.2013.06.13.02.11.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:20 -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 01/10] USB: OHCI: Properly handle ohci-at91 suspend Date: Thu, 13 Jun 2013 14:40:52 +0530 Message-Id: <1371114661-2207-2-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371114661-2207-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371114661-2207-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmPhpxL3iHohpcIive3ajWuU2uebi0PVuhTIWetpCKt11HA1thZq38hMW0PMayTlPvRRCLO X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 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 --- 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)