From patchwork Mon Jul 22 09:32:44 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: 18477 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E9A2D25E1F for ; Mon, 22 Jul 2013 09:33:47 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id a11sf8688578qen.4 for ; Mon, 22 Jul 2013 02:33:47 -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=PZCPYrxT4+CNKh/GAtseg6hbGMt3SUgIRu/r8yHjeQSXAw1/GqUhTz7OxH5bz0esJA 2WK96szhLOE3u4w91CkI+IwE7JoBWbx2u90MKh5XTGO6Gjf3vyXtGGKOsQewp8kkT+2R lB3mQVdmSQhYacq8AE7ZVKOGUQJx+fphh0HxNaCRkmDTwh/mvjUwa5UsJ2pDbaYRAGgy YYhpHYUXnASGm3avU7c1QqBu97XAnXvHrVsmP/QfuzEJ6wuPwFkkPfpmkcQ2hwRDTRlR 45QkxbOOdgjLSfF0RMBrKL5Bf8T23Six90VvnwLZJ9QeFeHQojG74Jgtlbp0SshNxp2R HAaw== X-Received: by 10.236.20.83 with SMTP id o59mr15420081yho.28.1374485627656; Mon, 22 Jul 2013 02:33:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.25.1 with SMTP id y1ls2616545qef.87.gmail; Mon, 22 Jul 2013 02:33:47 -0700 (PDT) X-Received: by 10.220.82.9 with SMTP id z9mr7062057vck.0.1374485627437; Mon, 22 Jul 2013 02:33:47 -0700 (PDT) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx.google.com with ESMTPS id ha3si6834332vdb.147.2013.07.22.02.33.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.54 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.54; Received: by mail-vb0-f54.google.com with SMTP id q12so4635942vbe.13 for ; Mon, 22 Jul 2013 02:33:47 -0700 (PDT) X-Received: by 10.52.120.77 with SMTP id la13mr7620960vdb.23.1374485627366; Mon, 22 Jul 2013 02:33:47 -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 yu8csp46457veb; Mon, 22 Jul 2013 02:33:46 -0700 (PDT) X-Received: by 10.68.212.229 with SMTP id nn5mr29739835pbc.44.1374485626181; Mon, 22 Jul 2013 02:33:46 -0700 (PDT) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by mx.google.com with ESMTPS id gk2si18158921pbb.229.2013.07.22.02.33.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.170 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.170; Received: by mail-pd0-f170.google.com with SMTP id x11so6668981pdj.1 for ; Mon, 22 Jul 2013 02:33:45 -0700 (PDT) X-Received: by 10.68.28.232 with SMTP id e8mr29933687pbh.94.1374485625785; Mon, 22 Jul 2013 02:33:45 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.229]) by mx.google.com with ESMTPSA id bb1sm24977759pbc.10.2013.07.22.02.33.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:45 -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 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Date: Mon, 22 Jul 2013 15:02:44 +0530 Message-Id: <1374485566-3997-10-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQlOOyktgiJBSEicCv5h4mtZ21TrLCNKoodCyHslITct2glg4LGzfoKjkXtDOImZOqACPc25 X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.54 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)