From patchwork Wed Jun 19 12:12:14 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: 17991 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ACFC32397B for ; Wed, 19 Jun 2013 12:13:22 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id u12sf6841131qcx.4 for ; Wed, 19 Jun 2013 05:13:22 -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=XU8hcZYUTILHqxqUwzBL2d+APwEIDZibYq7JEBaSg3w=; b=dGY80NJ4YExVcquuv17UgIl+wshkYfaJH8CpRDo8+AvuC6wbSiS+j+Uui7HS+OiquH 1QXW5IrrF0+B8e+uMJnOfmtXsuMCeUC+ojrlMsmfpnN5ZHO9GJ0lfeHFD/ws/+30V3a9 kPyBI7g39u6AZYNczmzYhoYZoVuocWAhiVHQ0J9ZeYoFoFSzhTBwtfYK/7cdBRaPgRti hleKE65UY49/UOm5+SmA9nd4cBBP4mZv6kc/TtZdcvbt5xGoX4utSa5CoS7FgR8ugFXA j7EAvTGsX+HBqCaGOZiZolWp7yoNA74184hmTN47NTf/mJta+tojSi3nGArJYp69MXtv +mGA== X-Received: by 10.236.112.33 with SMTP id x21mr1326300yhg.57.1371644002535; Wed, 19 Jun 2013 05:13:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.162 with SMTP id v2ls126319qef.8.gmail; Wed, 19 Jun 2013 05:13:22 -0700 (PDT) X-Received: by 10.220.67.81 with SMTP id q17mr524390vci.64.1371644002376; Wed, 19 Jun 2013 05:13:22 -0700 (PDT) Received: from mail-ve0-x236.google.com (mail-ve0-x236.google.com [2607:f8b0:400c:c01::236]) by mx.google.com with ESMTPS id zp6si6433036vdb.119.2013.06.19.05.13.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:22 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::236 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::236; Received: by mail-ve0-f182.google.com with SMTP id ox1so3995483veb.13 for ; Wed, 19 Jun 2013 05:13:22 -0700 (PDT) X-Received: by 10.52.37.132 with SMTP id y4mr706673vdj.46.1371644002277; Wed, 19 Jun 2013 05:13: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.165.8 with SMTP id yu8csp106244veb; Wed, 19 Jun 2013 05:13:21 -0700 (PDT) X-Received: by 10.66.197.227 with SMTP id ix3mr6526839pac.105.1371644001236; Wed, 19 Jun 2013 05:13:21 -0700 (PDT) Received: from mail-pb0-x22a.google.com (mail-pb0-x22a.google.com [2607:f8b0:400e:c01::22a]) by mx.google.com with ESMTPS id z5si10751679pau.142.2013.06.19.05.13.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:21 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22a is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::22a; Received: by mail-pb0-f42.google.com with SMTP id un1so5002929pbc.29 for ; Wed, 19 Jun 2013 05:13:20 -0700 (PDT) X-Received: by 10.68.184.100 with SMTP id et4mr2531498pbc.48.1371644000772; Wed, 19 Jun 2013 05:13:20 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id e2sm22925142pbc.23.2013.06.19.05.13.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13: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-kernel@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH V3 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Date: Wed, 19 Jun 2013 17:42:14 +0530 Message-Id: <1371643936-3314-10-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmQ8v0SZNcXR8kp+cAIt7yE1mCeGQsYNIEgmgO+bb0gyXPLPUMxuYmYjHIhQdWTgesXWBxx X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::236 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-pxa27x glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_hcd_pxa27x_drv_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Cc: Arnd Bergmann Cc: Alan Stern Cc: Greg KH Cc: linux-usb@vger.kernel.org V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". --- drivers/usb/host/ohci-pxa27x.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 3a9c01d..1dc2a72 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c @@ -564,13 +564,19 @@ static int ohci_hcd_pxa27x_drv_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); + bool do_wakeup = device_may_wakeup(dev); + int ret; if (time_before(jiffies, ohci->ohci.next_statechange)) msleep(5); ohci->ohci.next_statechange = jiffies; + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + pxa27x_stop_hc(ohci, dev); - return 0; + return ret; } static int ohci_hcd_pxa27x_drv_resume(struct device *dev)