From patchwork Thu Jun 13 09:16:28 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: 17886 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C04F25BE0 for ; Thu, 13 Jun 2013 09:17:27 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id f73sf4312414yha.10 for ; Thu, 13 Jun 2013 02:17:26 -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=X0+ZHfp+ycCvWTIYvKOVh+7Uiwc0LF+LqiPiLtoKzj4=; b=ai105S+bS+USdHyxss0gZ3vB7bRYDQX8qGOEvLPhAz9Yd6lyS0cLftRKcdQMj2d3h6 eVeCmh10HujTDbJ3DPF0WP0H5hp74tfcCPbpTHn2foeb62BTKDPz0UI07Jp3u/X4H5mm dh1M9lsOvBJpZHhc8MF7e835gona/ScwkSejliDrYPGwL5L8y6R7DV2Hx9LO+qDVmOO5 BsgHeu/5owUF7YJOG9ruYnHcjZ28RJvQWi3om3bWU4D7qdkdr56449iRnKS6dwHbydIr o29ZbkZq4KRfJywvQYtGwaYNcOqEpvE6nE7PVtCBLsi7OhomS8AT9LUW5acZDJFDR31/ LoEQ== X-Received: by 10.224.59.205 with SMTP id m13mr1158756qah.7.1371115046863; Thu, 13 Jun 2013 02:17:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.86.202 with SMTP id r10ls4122174qez.86.gmail; Thu, 13 Jun 2013 02:17:26 -0700 (PDT) X-Received: by 10.52.26.140 with SMTP id l12mr9534024vdg.29.1371115046715; Thu, 13 Jun 2013 02:17:26 -0700 (PDT) Received: from mail-vb0-x22c.google.com (mail-vb0-x22c.google.com [2607:f8b0:400c:c02::22c]) by mx.google.com with ESMTPS id zt2si10097626vdb.76.2013.06.13.02.17.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:26 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22c 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::22c; Received: by mail-vb0-f44.google.com with SMTP id e15so3158983vbg.31 for ; Thu, 13 Jun 2013 02:17:26 -0700 (PDT) X-Received: by 10.52.171.80 with SMTP id as16mr9590936vdc.90.1371115046591; Thu, 13 Jun 2013 02:17:26 -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 gx3csp13746vec; Thu, 13 Jun 2013 02:17:26 -0700 (PDT) X-Received: by 10.68.3.107 with SMTP id b11mr24051815pbb.118.1371115045625; Thu, 13 Jun 2013 02:17:25 -0700 (PDT) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by mx.google.com with ESMTPS id uh1si13473269pab.210.2013.06.13.02.17.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.171 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.171; Received: by mail-pd0-f171.google.com with SMTP id y14so8251159pdi.16 for ; Thu, 13 Jun 2013 02:17:25 -0700 (PDT) X-Received: by 10.68.136.3 with SMTP id pw3mr40798pbb.2.1371115045245; Thu, 13 Jun 2013 02:17:25 -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.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:24 -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 09/10] USB: OHCI: Properly handle ohci-sm501 suspend Date: Thu, 13 Jun 2013 14:46:28 +0530 Message-Id: <1371114989-2342-10-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: ALoCoQnl8vpFZAQwPJAonnAkCQ9qHXSjUjaxzLGvJ2YHeOrP/FJm/ExJhq8v8p6vrDYQAVXVRhpm X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22c 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-sm501 glue was not properly handled as it was not suspending generic part of ohci controller.Calling explicitly the ohci_suspend() routine in ohci_sm501_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-sm501.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index d479d5d..81ebbce 100644 --- a/drivers/usb/host/ohci-sm501.c +++ b/drivers/usb/host/ohci-sm501.c @@ -216,14 +216,25 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev) static int ohci_sm501_suspend(struct platform_device *pdev, pm_message_t msg) { struct device *dev = &pdev->dev; - struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(pdev)); + struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct ohci_hcd *ohci = hcd_to_ohci(hcd); + bool do_wakeup = device_may_wakeup(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; sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0); - return 0; + return ret; } static int ohci_sm501_resume(struct platform_device *pdev)