From patchwork Thu Jun 13 09:10:59 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: 17875 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 86C1B25BE0 for ; Thu, 13 Jun 2013 09:11:57 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 1sf11169517qee.10 for ; Thu, 13 Jun 2013 02:11:57 -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=CPUKiwAx4RopqS2z6Z9LtvzPFxy9LnLUdAIuPYqkyjGYjV02HAK47y+BYgq5gGluwS JLOOmWy8vy09CMzfnM10ug6jnZ6AiJ9uy922ztDI1R3T2uXLQtht92+FRs24J2+z0iWW 40PdWhXCRDgmueBYk9uD1Pq2EIMQ21WBZkfLC1Msl7rn/8mm9Byw2hMxgh4WJTloaxZE qdVjRLqdyFVRQH9OQlE8gq5wdWLplp5hW/NSQCet6ife/Ih/DilEUe0HmS74bAjI1/lq gH0GQjPv/Hxq6GXyf1cNHWV4ky3Jx8BPIJrdWZs1BK0NVG/119Z5vfaVCEb0Y/Nahcew hdnw== X-Received: by 10.224.18.203 with SMTP id x11mr1161128qaa.2.1371114717359; Thu, 13 Jun 2013 02:11:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.122.5 with SMTP id lo5ls3960881qeb.27.gmail; Thu, 13 Jun 2013 02:11:57 -0700 (PDT) X-Received: by 10.52.176.10 with SMTP id ce10mr9476071vdc.74.1371114717182; Thu, 13 Jun 2013 02:11:57 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id sz6si10095988vdc.62.2013.06.13.02.11.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 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.173; Received: by mail-vc0-f173.google.com with SMTP id ht10so3532205vcb.32 for ; Thu, 13 Jun 2013 02:11:57 -0700 (PDT) X-Received: by 10.58.211.7 with SMTP id my7mr3653352vec.54.1371114717040; Thu, 13 Jun 2013 02:11:57 -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 gx3csp13571vec; Thu, 13 Jun 2013 02:11:56 -0700 (PDT) X-Received: by 10.66.172.197 with SMTP id be5mr1970559pac.50.1371114716093; Thu, 13 Jun 2013 02:11:56 -0700 (PDT) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by mx.google.com with ESMTPS id ra8si13479514pab.120.2013.06.13.02.11.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.175 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.175; Received: by mail-pd0-f175.google.com with SMTP id 4so11066066pdd.34 for ; Thu, 13 Jun 2013 02:11:55 -0700 (PDT) X-Received: by 10.68.105.164 with SMTP id gn4mr23708102pbb.42.1371114715697; Thu, 13 Jun 2013 02:11:55 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id p2sm28451974pag.22.2013.06.13.02.11.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:11:55 -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 08/10] USB: OHCI: Properly handle ohci-pxa27x suspend Date: Thu, 13 Jun 2013 14:40:59 +0530 Message-Id: <1371114661-2207-9-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371114661-2207-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371114661-2207-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQk4HgZfZ5G2USgkiPcMIr/B8Xt5f2pwF/rpSwEJns7tjGUDxw/JyjpgJDk1SnpKrhObWS0j X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 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)