From patchwork Thu Jul 25 10:53:58 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: 18567 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2040425DF6 for ; Thu, 25 Jul 2013 10:54:45 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf77711vcb.7 for ; Thu, 25 Jul 2013 03:54:44 -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=6afHxrQrrgtBPNiPMQonIKF3x2kVDhdNoS87qo9YLZ4=; b=IfYu+UoKvLY6zOaLgnXZrR/dY9ZSr1Wqw07L2tcZmiKHf1n/bDWupDy9Ze2+LGBxEK arD1hSiquzzSgApYVMYrotx3Z4Hx/ZxS59oU3Ia7KVuMKuruSfjhjBrPZKtHCU+41HT6 rl2frCvfLBuz5lZFc/Skykpo2FFjAlQQ6/b8nw/dMCPQ1DrELxR4X3GEfNG0D/NDGcBD zI3lLC+3C+Qi2BbrGBZVdmeOVf4mUdtVRMRZ2D7501lYHwiWbPHv1BXbw7/sHxPNUXSk LVk73mX4cs/XJF9Q08IcTs5vpssh0SWhAQF47iKvPERjtqSb3sMU0bzhk+xWPyGULZCm 0deA== X-Received: by 10.224.7.7 with SMTP id b7mr3739498qab.5.1374749684826; Thu, 25 Jul 2013 03:54:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.48.170 with SMTP id m10ls618909qen.41.gmail; Thu, 25 Jul 2013 03:54:44 -0700 (PDT) X-Received: by 10.52.116.70 with SMTP id ju6mr375905vdb.112.1374749684729; Thu, 25 Jul 2013 03:54:44 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id ur15si12156198veb.146.2013.07.25.03.54.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 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.182; Received: by mail-vc0-f182.google.com with SMTP id hf12so47960vcb.27 for ; Thu, 25 Jul 2013 03:54:44 -0700 (PDT) X-Received: by 10.58.119.233 with SMTP id kx9mr17623999veb.3.1374749684623; Thu, 25 Jul 2013 03:54:44 -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 yu8csp71172veb; Thu, 25 Jul 2013 03:54:43 -0700 (PDT) X-Received: by 10.66.179.78 with SMTP id de14mr3190438pac.18.1374749683391; Thu, 25 Jul 2013 03:54:43 -0700 (PDT) Received: from mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) by mx.google.com with ESMTPS id mu18si13355456pab.60.2013.07.25.03.54.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.42 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.160.42; Received: by mail-pb0-f42.google.com with SMTP id un1so609790pbc.15 for ; Thu, 25 Jul 2013 03:54:43 -0700 (PDT) X-Received: by 10.66.157.68 with SMTP id wk4mr36414795pab.72.1374749683013; Thu, 25 Jul 2013 03:54:43 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:42 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Date: Thu, 25 Jul 2013 16:23:58 +0530 Message-Id: <1374749640-30062-10-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> References: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQnR2evy1ojcZ+2QI+FxZ4/DiQL50+WVIiJ3GVC0tZcsYa1VBJElyvQnWHYwlUKCBcgp2ZMB X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 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 Acked-by: Alan Stern Cc: Arnd Bergmann 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". V4: -The do_wakeup and ret variable alignment is removed. --- 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..5fb91f1 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)