From patchwork Thu Jun 13 09:16:27 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: 17885 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C4C8C25BE0 for ; Thu, 13 Jun 2013 09:17:22 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id l109sf9896570yhq.9 for ; Thu, 13 Jun 2013 02:17: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=ltmm53RiMoUDoFfovf9/9kaMCbT8bupAOWx1UBprwxM=; b=DF39BdRGxSq6s9RuwgjmN6KExqf3d9M6lsiPRAQv/FHj7FH8wLuRg+1xXwA9AOhYoG 1xTt+GlpY0m7b0T0LcNoaH6c/yGZ9Gwl9GyC/omxK5+QSwkeNEzQeu6xhRg0szQ3sAkO 7aKSHuyv7OWyqPevffCNQXw3H2Ta5uKkzW9FULWemH0W+C43EUelKUGugaNZzBxTtDsj +pBYlA1b/MVqUeSDbsRh6qxHgCBw+69DJlXf8WwUGt1kA3XimDOM/Ng2dnX1l2b5Mdt6 T3Wsq+2Kcud3lL2jYtwxoJ6w2L/1Lhlr2JiS93NzJNU8sRIb+QfVAK3l4gjT0K67JUP4 sGNA== X-Received: by 10.236.220.225 with SMTP id o91mr6880yhp.6.1371115042580; Thu, 13 Jun 2013 02:17:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.133.102 with SMTP id pb6ls1332475qeb.80.gmail; Thu, 13 Jun 2013 02:17:22 -0700 (PDT) X-Received: by 10.220.185.136 with SMTP id co8mr11109870vcb.25.1371115042382; Thu, 13 Jun 2013 02:17:22 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id zp6si10109105vdb.28.2013.06.13.02.17.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id ib11so6955596vcb.17 for ; Thu, 13 Jun 2013 02:17:22 -0700 (PDT) X-Received: by 10.220.192.138 with SMTP id dq10mr11224885vcb.23.1371115042256; Thu, 13 Jun 2013 02:17: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.191.99 with SMTP id gx3csp13744vec; Thu, 13 Jun 2013 02:17:21 -0700 (PDT) X-Received: by 10.66.255.41 with SMTP id an9mr1934692pad.44.1371115041319; Thu, 13 Jun 2013 02:17:21 -0700 (PDT) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [2607:f8b0:400e:c03::22f]) by mx.google.com with ESMTPS id tq5si13478524pab.175.2013.06.13.02.17.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:21 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22f is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::22f; Received: by mail-pa0-f47.google.com with SMTP id kl14so4533034pab.20 for ; Thu, 13 Jun 2013 02:17:20 -0700 (PDT) X-Received: by 10.66.158.101 with SMTP id wt5mr1950674pab.8.1371115040607; Thu, 13 Jun 2013 02:17:20 -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.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17: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-dev@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH V2 08/10] USB: OHCI: Properly handle ohci-pxa27x suspend Date: Thu, 13 Jun 2013 14:46:27 +0530 Message-Id: <1371114989-2342-9-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: ALoCoQnlu4lRI0euiJpWkyHNqCG6/UFiLcYEx0PNMYLM/ffTXdb31wmgt8kcPEFWWdTfzrb/o7NI X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 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. 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-pxa27x.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 3a9c01d..d441a87 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c @@ -564,13 +564,23 @@ 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; + + 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->ohci.next_statechange)) msleep(5); ohci->ohci.next_statechange = jiffies; pxa27x_stop_hc(ohci, dev); - return 0; + return ret; } static int ohci_hcd_pxa27x_drv_resume(struct device *dev)