From patchwork Thu Jun 13 09:16:25 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: 17883 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E25025BE0 for ; Thu, 13 Jun 2013 09:17:14 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id k10sf1756981wiv.3 for ; Thu, 13 Jun 2013 02:17:13 -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=v7Rhmij2mEZgwn2kgIpmDhrLkk32bFa56GEnp7/hQgs=; b=HVPQ3hwgLVpE+sk3H29ArxigT0HVEsSJAmmTgjeYOpnwhnqyIRN18+rgqToCF5SaX2 luD1+dQL0/qwsrSATKyp1QGVoiXhoARopmJ3cDtYjaHcUsf72cnm+GZlGcB0Zh3G5UE7 MNS5Q1yjISS05YdRZTPLkIQUB1edfUZEiv9HtzDVv4sLqJu8SM5uWoqDj+1DZmXmrTwi jeoFawlw2iHl4NbVkTG+xery9XggH1t+LD2jKfbQ4yK2CnpxJb50IRFqQmOED0AoN48o xTmVhDCrs/gvESLe1p+7wCMeE2wdUyDc/SrAtEil5VUGEkDUBN7wLnHz07Y2dc54qPhY R7yQ== X-Received: by 10.180.36.211 with SMTP id s19mr1436023wij.1.1371115033796; Thu, 13 Jun 2013 02:17:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.83.71 with SMTP id o7ls401508wiy.33.gmail; Thu, 13 Jun 2013 02:17:13 -0700 (PDT) X-Received: by 10.194.60.5 with SMTP id d5mr11013677wjr.26.1371115033701; Thu, 13 Jun 2013 02:17:13 -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 z7si2457846wiy.4.2013.06.13.02.17.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:13 -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 da11so7433320veb.20 for ; Thu, 13 Jun 2013 02:17:12 -0700 (PDT) X-Received: by 10.58.22.74 with SMTP id b10mr11093781vef.47.1371115032619; Thu, 13 Jun 2013 02:17:12 -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 gx3csp13738vec; Thu, 13 Jun 2013 02:17:12 -0700 (PDT) X-Received: by 10.66.122.8 with SMTP id lo8mr1819220pab.165.1371115031634; Thu, 13 Jun 2013 02:17:11 -0700 (PDT) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [2607:f8b0:400e:c03::22b]) by mx.google.com with ESMTPS id kx5si11323181pbc.320.2013.06.13.02.17.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:11 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22b is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::22b; Received: by mail-pa0-f43.google.com with SMTP id hz11so7018622pad.30 for ; Thu, 13 Jun 2013 02:17:11 -0700 (PDT) X-Received: by 10.66.145.98 with SMTP id st2mr2001400pab.24.1371115031245; Thu, 13 Jun 2013 02:17:11 -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.17.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:10 -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 06/10] USB: OHCI: Properly handle ohci-omap suspend Date: Thu, 13 Jun 2013 14:46:25 +0530 Message-Id: <1371114989-2342-7-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: ALoCoQlxuiJpuThOY6p2buVkmQK9ggyqllYdVX++WHT8GGGh7LkQkNuHER7vjxMOo7bJWjbZ4sGu 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-omap glue was not properly handled as it was not suspending generic part of ohci controller.Calling explicitly the ohci_suspend() routine in ohci_omap_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-omap.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index b900dba..9144315 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -423,16 +423,27 @@ static int ohci_hcd_omap_drv_remove(struct platform_device *dev) #ifdef CONFIG_PM -static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message) +static int ohci_omap_suspend(struct platform_device *pdev, pm_message_t message) { - struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev)); + 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; + + 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 (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; omap_ohci_clock_power(0); - return 0; + return ret; } static int ohci_omap_resume(struct platform_device *dev)