From patchwork Tue Jun 25 06:39:42 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: 18095 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F253825D00 for ; Tue, 25 Jun 2013 06:40:47 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id f12sf16206734vbg.2 for ; Mon, 24 Jun 2013 23:40: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=Q2i2PH1pkkOxdKbHUYhUaFQ+Cyt6FG1gC2XZaFGzZPE=; b=g0cB5zijFid20eh9cFCMtPmHoKLWftPKSy1bK4uD7JB5qj3uV3X4ALX0cn3Hk5dAZ4 NVzElpBL0FBqE69Qpsiohub5e/6BeLEUndRsLkQfC/fKDBJQBezU7rEMlDb7tNe4LuXX HArX5NGfJn7C4pNyw5y0TAXBC4xlbETcsthGGI4Dh0aHZamHvFCid6hiZT2gVmxgRG02 frN2UzSY/q24lfGtXpuHcTzxPl/kwFU2YNB5M9Jp1s05vrnGcBCg6tQotBUD00JZI8mw f7elXVaa4QS//qng/IQVlqYyQvX+rhWqu/buNh9tT/02EdZXRzW4y8C1Oiwan/tP7ZNa dJbA== X-Received: by 10.236.193.196 with SMTP id k44mr14772937yhn.40.1372142447714; Mon, 24 Jun 2013 23:40:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.86.232 with SMTP id s8ls2376302qez.94.gmail; Mon, 24 Jun 2013 23:40:47 -0700 (PDT) X-Received: by 10.58.236.42 with SMTP id ur10mr13130184vec.48.1372142447569; Mon, 24 Jun 2013 23:40:47 -0700 (PDT) Received: from mail-vb0-x235.google.com (mail-vb0-x235.google.com [2607:f8b0:400c:c02::235]) by mx.google.com with ESMTPS id sz6si5884662vdc.62.2013.06.24.23.40.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:47 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::235 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::235; Received: by mail-vb0-f53.google.com with SMTP id p12so9088041vbe.12 for ; Mon, 24 Jun 2013 23:40:47 -0700 (PDT) X-Received: by 10.58.29.228 with SMTP id n4mr2219054veh.50.1372142447481; Mon, 24 Jun 2013 23:40: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 yu8csp55571veb; Mon, 24 Jun 2013 23:40:46 -0700 (PDT) X-Received: by 10.68.110.131 with SMTP id ia3mr26784914pbb.181.1372142446497; Mon, 24 Jun 2013 23:40:46 -0700 (PDT) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [2607:f8b0:400e:c03::22e]) by mx.google.com with ESMTPS id ra8si10881674pab.265.2013.06.24.23.40.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:46 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22e is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::22e; Received: by mail-pa0-f46.google.com with SMTP id fa11so12144280pad.33 for ; Mon, 24 Jun 2013 23:40:46 -0700 (PDT) X-Received: by 10.68.196.231 with SMTP id ip7mr26373415pbc.61.1372142446116; Mon, 24 Jun 2013 23:40:46 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id mr3sm6037160pbb.27.2013.06.24.23.40.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40: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 V4 07/11] USB: OHCI: Properly handle ohci-omap suspend Date: Tue, 25 Jun 2013 12:09:42 +0530 Message-Id: <1372142386-10691-8-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmLfahRtYUK+ITwC4c/fHrn3/QvcQQWyy+WoemOrn25k+QroPJlaCzFl781FLLjM78JlyT6 X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::235 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-omap glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_omap_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-omap.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 10ba58d..baefc46 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -432,16 +432,23 @@ static int ohci_hcd_omap_drv_remove(struct platform_device *dev) #ifdef CONFIG_PM -static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message) +static int ohci_omap_suspend(struct platform_device *pdev, pm_message_t message) { - struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev)); + struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct ohci_hcd *ohci = hcd_to_ohci(hcd); + bool do_wakeup = device_may_wakeup(&pdev->dev); + int ret; if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + omap_ohci_clock_power(0); - return 0; + return ret; } static int ohci_omap_resume(struct platform_device *dev)