From patchwork Thu Jun 13 09:11:01 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: 17877 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 4C10A25BE0 for ; Thu, 13 Jun 2013 09:12:07 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 1sf11172794qee.2 for ; Thu, 13 Jun 2013 02:12:07 -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=3uC+nLV5Z59MTT8ntSFxruT+ixcuHCa5AeuDsQrreNI=; b=mTmiMmjVv9OTtFVHf/3HVFISJ4GyytgABdjaaSnc/BhjhLz9cgtmBH1QA2L9JKKNjx nx5LRfxnvclmOj09hmu13nCkRneEDhlpoPsI5fQMNw18cACpsuN36MxBL68DfzZhwDrk WXXq8LB/d5cn3rVtiPTbT/0n9lDlUuKO/mQhhDFOXsTSIVjk3EbAQDUlA7qUNvWkJAeO B+DZ2VnTm8N6afeNL9a11SCA7LW/OhXKl0ArFJWNggkPv/pju/PNf+PnLbddNPJ+PTvK +9XFLS40GX33LEHxlgoNg7ulEmhSBzhG+HKOkwEiMA2vUXl8SLIbRUocxXTaty6B47sn evLQ== X-Received: by 10.236.153.202 with SMTP id f50mr8319838yhk.48.1371114727089; Thu, 13 Jun 2013 02:12:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.110.194 with SMTP id ic2ls4050993qeb.36.gmail; Thu, 13 Jun 2013 02:12:06 -0700 (PDT) X-Received: by 10.58.40.42 with SMTP id u10mr6432689vek.39.1371114726922; Thu, 13 Jun 2013 02:12:06 -0700 (PDT) Received: from mail-vb0-x235.google.com (mail-vb0-x235.google.com [2607:f8b0:400c:c02::235]) by mx.google.com with ESMTPS id zt2si10101330vdb.37.2013.06.13.02.12.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:12:06 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::235 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:c02::235; Received: by mail-vb0-f53.google.com with SMTP id p12so6838323vbe.12 for ; Thu, 13 Jun 2013 02:12:06 -0700 (PDT) X-Received: by 10.52.155.67 with SMTP id vu3mr9527925vdb.94.1371114726803; Thu, 13 Jun 2013 02:12:06 -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 gx3csp13578vec; Thu, 13 Jun 2013 02:12:06 -0700 (PDT) X-Received: by 10.68.3.107 with SMTP id b11mr24033628pbb.118.1371114725787; Thu, 13 Jun 2013 02:12:05 -0700 (PDT) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [2607:f8b0:400e:c03::231]) by mx.google.com with ESMTPS id z5si3147725pau.55.2013.06.13.02.12.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:12:05 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::231 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::231; Received: by mail-pa0-f49.google.com with SMTP id ld11so4910808pab.8 for ; Thu, 13 Jun 2013 02:12:05 -0700 (PDT) X-Received: by 10.66.83.7 with SMTP id m7mr1892354pay.150.1371114725386; Thu, 13 Jun 2013 02:12:05 -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.12.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:12:04 -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 10/10] USB: OHCI: Properly handle ohci-spear suspend Date: Thu, 13 Jun 2013 14:41:01 +0530 Message-Id: <1371114661-2207-11-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: ALoCoQkzRzb2K0svUwECwVYRQshSaIju26pub+cEU0iyRiYbVg2R2kbpuhGzv5q/5UfiorETAEfD X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::235 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-spear glue was not properly handled as it was not suspending generic part of ohci controller.Calling explicitly the ohci_suspend() routine in spear_ohci_hcd_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-spear.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 31ff3fc..2ff867b 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c @@ -130,12 +130,22 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev) } #if defined(CONFIG_PM) -static int spear_ohci_hcd_drv_suspend(struct platform_device *dev, +static int spear_ohci_hcd_drv_suspend(struct platform_device *pdev, pm_message_t message) { - struct usb_hcd *hcd = platform_get_drvdata(dev); + struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct spear_ohci *sohci_p = to_spear_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); @@ -143,7 +153,7 @@ static int spear_ohci_hcd_drv_suspend(struct platform_device *dev, clk_disable_unprepare(sohci_p->clk); - return 0; + return ret; } static int spear_ohci_hcd_drv_resume(struct platform_device *dev)