From patchwork Thu Jul 25 10:53:54 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: 18563 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 194EE25DF6 for ; Thu, 25 Jul 2013 10:54:33 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf1446411ghb.2 for ; Thu, 25 Jul 2013 03:54:32 -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=RSm5l41vDjY6Ywfk5WNg3TtqNIe5Yaq2k+H+l35x7CKeWue9ouwmxqeP1YF2n06LYd bJ9hH+QTzAGFMkefzU4H83PtaHU7yTGCjh7UHxSuD+1ANYPaOZdYBlWy7TEmD94SU9r+ CjC3mRQJlxKkCKuRwfFVkC7aE37czKkaYDCV9qjzLEnEZOeCnZFyKs3tmNYc1AmoCS2g 4WPUAIccqjFDvOgXbgrh42FHPcn3DPP65uIN5KXafeB/K9Fo8tK46AG4v7CJa8L4DjEt erwC7CMfo4+aFY3GDJlZnqF/x3fmDAXbx39UujC0rYyNHqv+cIb2MH0obD0vip6d82GM S+dQ== X-Received: by 10.236.125.200 with SMTP id z48mr23219173yhh.55.1374749672825; Thu, 25 Jul 2013 03:54:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.236 with SMTP id 12ls577776qeh.36.gmail; Thu, 25 Jul 2013 03:54:32 -0700 (PDT) X-Received: by 10.220.197.10 with SMTP id ei10mr221934vcb.68.1374749672683; Thu, 25 Jul 2013 03:54:32 -0700 (PDT) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id o8si124365vcy.94.2013.07.25.03.54.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.46; Received: by mail-vb0-f46.google.com with SMTP id w8so370931vbf.33 for ; Thu, 25 Jul 2013 03:54:32 -0700 (PDT) X-Received: by 10.52.77.5 with SMTP id o5mr14520729vdw.46.1374749672596; Thu, 25 Jul 2013 03:54:32 -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 yu8csp71156veb; Thu, 25 Jul 2013 03:54:31 -0700 (PDT) X-Received: by 10.68.60.132 with SMTP id h4mr47261125pbr.177.1374749671531; Thu, 25 Jul 2013 03:54:31 -0700 (PDT) Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by mx.google.com with ESMTPS id os4si24082905pac.236.2013.07.25.03.54.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.43 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.160.43; Received: by mail-pb0-f43.google.com with SMTP id md12so603591pbc.30 for ; Thu, 25 Jul 2013 03:54:31 -0700 (PDT) X-Received: by 10.68.189.8 with SMTP id ge8mr18450405pbc.160.1374749670962; Thu, 25 Jul 2013 03:54:30 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:30 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Date: Thu, 25 Jul 2013 16:23:54 +0530 Message-Id: <1374749640-30062-6-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> References: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQkXmWpApd5N8IPbpyyf+/85s9ZV/d6jIdpTxHDFtOIkKZIQ0mN8aRc19H7uNpSWfrchNtAB X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.46 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)