From patchwork Mon Jul 22 09:32: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: 18475 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B26625E1F for ; Mon, 22 Jul 2013 09:33:37 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r9sf7473900yen.11 for ; Mon, 22 Jul 2013 02:33:37 -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=6SbpfgSwxZlGRIUlJhfbS6wayfMV4N+fA5pqg2s58D0=; b=PGRrZRSBaSlJ3J1XtU/Xg1IgnsiwvNEEsvpxNQVV7f88MWS5brCOFspxbWuTo+/gZd Fm67hL1+YyIrzRew2M9I6/spkQBMXZVtLlAslF0j3gouhJo0rkauqdv3aO7spmoPL70q nnggR9/+NHNl3l60NdnE8lLdfD6Onr3spDBqh+lpYcXVMOulsjKd0IBrKgqx8inXLy5C YN7U4L8CPM+/qi4iaiFYHK2hCJBikRbz0pl5ZtC5UwzVhZJ8c9wcnujMToPx6ZCiwM4X AC75xIb/lP3KK0Lr7TeNKiM+4M+repTbbgZclQ+iQPu+ai6yYiibeNxs8jVa9OfSZ2dp PtOQ== X-Received: by 10.236.77.166 with SMTP id d26mr14495439yhe.40.1374485617033; Mon, 22 Jul 2013 02:33:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.27.66 with SMTP id r2ls2589163qeg.24.gmail; Mon, 22 Jul 2013 02:33:36 -0700 (PDT) X-Received: by 10.58.234.161 with SMTP id uf1mr8959109vec.57.1374485616933; Mon, 22 Jul 2013 02:33:36 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id ur15si6833478veb.146.2013.07.22.02.33.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 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.182; Received: by mail-vc0-f182.google.com with SMTP id hf12so1184765vcb.13 for ; Mon, 22 Jul 2013 02:33:36 -0700 (PDT) X-Received: by 10.52.95.113 with SMTP id dj17mr7705068vdb.82.1374485616840; Mon, 22 Jul 2013 02:33: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 yu8csp46447veb; Mon, 22 Jul 2013 02:33:36 -0700 (PDT) X-Received: by 10.66.218.226 with SMTP id pj2mr10108805pac.62.1374485615865; Mon, 22 Jul 2013 02:33:35 -0700 (PDT) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx.google.com with ESMTPS id fa9si18239497pab.195.2013.07.22.02.33.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.182 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.182; Received: by mail-pd0-f182.google.com with SMTP id r10so6621045pdi.13 for ; Mon, 22 Jul 2013 02:33:35 -0700 (PDT) X-Received: by 10.66.136.237 with SMTP id qd13mr31186350pab.74.1374485615144; Mon, 22 Jul 2013 02:33:35 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.229]) by mx.google.com with ESMTPSA id bb1sm24977759pbc.10.2013.07.22.02.33.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33: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 07/11] USB: OHCI: Properly handle ohci-omap suspend Date: Mon, 22 Jul 2013 15:02:42 +0530 Message-Id: <1374485566-3997-8-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: ALoCoQkzwi/73rcdwJZ9E7nGIlxBAnan8blfCN0wUQ9GYpuWeyJ8DQs9l3TBrqTPh/Qvs0Zh88+v X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 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 8149ef0..d13fb4f 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -431,16 +431,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)