From patchwork Thu Jun 20 09:36:05 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: 18012 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB3622393D for ; Thu, 20 Jun 2013 09:38:36 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id w16sf8159802vbb.0 for ; Thu, 20 Jun 2013 02:38:36 -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=yXScU1qWXgggnVflukWNZs0WqX7QUMfpclXatwGtDZI=; b=dh4ptgUAUoIRJ+SkCoD2uKXffhkBlnHS0YjdNneWrbPnUAnS6BztRJVLLFj+kP2yd5 EhI2xP5uyohsaVJ06cTd+BhNcW5Tg0kJ+fps5DFgDp8OkaqIkSWGLr01bhZ+MEDMfg2S HXda6KsLkohYVowXI4U2o9QsiOpQcD5RdexmVUDBKGlkuqnM8kHai2Maw6Erw/ApjJh1 3jHWPlp69/8Oc0Ml+ajVg4qD88EDVUfsA+4ChqAj77BjHu4GHXsEbo+n0MAReBIPW9FR YVb88R9/+CcWl7SdSZPmiallRuuN3tAXIYVj6iPr2l9X6Drwsgs6NHgn9wB0l2bLmjxe KXEg== X-Received: by 10.236.42.116 with SMTP id i80mr3758494yhb.26.1371721116685; Thu, 20 Jun 2013 02:38:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.108.74 with SMTP id hi10ls641725qeb.50.gmail; Thu, 20 Jun 2013 02:38:36 -0700 (PDT) X-Received: by 10.220.50.66 with SMTP id y2mr2246274vcf.84.1371721116546; Thu, 20 Jun 2013 02:38:36 -0700 (PDT) Received: from mail-vb0-x231.google.com (mail-vb0-x231.google.com [2607:f8b0:400c:c02::231]) by mx.google.com with ESMTPS id tk6si6579386vcb.47.2013.06.20.02.38.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:36 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::231 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::231; Received: by mail-vb0-f49.google.com with SMTP id 12so4509408vbf.36 for ; Thu, 20 Jun 2013 02:38:36 -0700 (PDT) X-Received: by 10.52.27.172 with SMTP id u12mr1526835vdg.64.1371721116416; Thu, 20 Jun 2013 02:38:36 -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 yu8csp13846veb; Thu, 20 Jun 2013 02:38:35 -0700 (PDT) X-Received: by 10.66.149.198 with SMTP id uc6mr6425010pab.61.1371721115410; Thu, 20 Jun 2013 02:38:35 -0700 (PDT) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [2607:f8b0:400e:c03::22a]) by mx.google.com with ESMTPS id ym5si21971pac.253.2013.06.20.02.38.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:35 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22a is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::22a; Received: by mail-pa0-f42.google.com with SMTP id rl6so6122218pac.29 for ; Thu, 20 Jun 2013 02:38:35 -0700 (PDT) X-Received: by 10.68.58.231 with SMTP id u7mr6595100pbq.144.1371721115008; Thu, 20 Jun 2013 02:38:35 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.192]) by mx.google.com with ESMTPSA id kq2sm35530pab.19.2013.06.20.02.38.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:34 -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 V4 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Date: Thu, 20 Jun 2013 15:06:05 +0530 Message-Id: <1371720968-7533-10-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmaPKPJgYpNfq/PI7F6/lN3M81a18wQBumgLp53sA/eJo0XwwkyrZO/Xdhv8Bq0BM8XP51X X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::231 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". 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)