From patchwork Mon Jul 22 09:32:40 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: 18473 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9556125E1F for ; Mon, 22 Jul 2013 09:33:26 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id f73sf8970321yha.2 for ; Mon, 22 Jul 2013 02:33:26 -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=4nZowkTnSgyqH5NZgcCo9K27KsM/+mQ3OcZ8f6Lf/gs=; b=YSSRHVH4EM4Z9hm+SrAbLPfRfSAq2yxDMwQ8m0qZzxSJyU9sNK79Gf+G7zhIJC5+Q2 sKLllpcqmMWXq2pRq2t5SXNBf7AZkY8ljllluD/YgcYidFDOFDXxRqEYLXK/aNsH3oEd ykr17emK7Bfqc7RvjGqwfNrwXeG0LMwoqFoXE7MH/f///xoeyzrLqISPf4lL0B98Jjyo 7T0GVjg3rzbVULf3K/YNfXOZtK7CuTbdKZNiFykzVLnwVyX9TM9q/Zdvf+42L1qkol17 OHX7kBQBH2Iz3ZCMiEhi/xyvUkTp+6+SnJgYcQ0Pf8DQnfT4jaMmpNzVuH0rEnYxfsF/ CbqA== X-Received: by 10.236.170.41 with SMTP id o29mr14853941yhl.53.1374485606324; Mon, 22 Jul 2013 02:33:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.128.34 with SMTP id nl2ls2538113qeb.39.gmail; Mon, 22 Jul 2013 02:33:26 -0700 (PDT) X-Received: by 10.52.19.10 with SMTP id a10mr105189vde.45.1374485606224; Mon, 22 Jul 2013 02:33:26 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id u10si6834650vcj.128.2013.07.22.02.33.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.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.128.172; Received: by mail-ve0-f172.google.com with SMTP id jz10so4938264veb.3 for ; Mon, 22 Jul 2013 02:33:26 -0700 (PDT) X-Received: by 10.220.67.10 with SMTP id p10mr8891343vci.85.1374485606135; Mon, 22 Jul 2013 02:33:26 -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 yu8csp46441veb; Mon, 22 Jul 2013 02:33:25 -0700 (PDT) X-Received: by 10.66.122.131 with SMTP id ls3mr30859794pab.2.1374485605126; Mon, 22 Jul 2013 02:33:25 -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 tw4si18187721pbc.61.2013.07.22.02.33.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:25 -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 4so6639331pdd.34 for ; Mon, 22 Jul 2013 02:33:24 -0700 (PDT) X-Received: by 10.68.160.193 with SMTP id xm1mr29831544pbb.88.1374485604735; Mon, 22 Jul 2013 02:33:24 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.229]) by mx.google.com with ESMTPSA id bb1sm24977759pbc.10.2013.07.22.02.33.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:24 -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 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Date: Mon, 22 Jul 2013 15:02:40 +0530 Message-Id: <1374485566-3997-6-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: ALoCoQl2XQWBt2MR0tr2FONL40w7V66K5+7weDtycAMLsEL+4OwynqoY8M4mjGdnEOvqLbMC+3fU X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.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-ep93xx glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_hcd_ep93xx_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-ep93xx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index 8704e9f..f0aaa48 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c @@ -174,13 +174,20 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_ { 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; + ep93xx_stop_hc(&pdev->dev); - return 0; + + return ret; } static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)