From patchwork Thu Jul 25 10:53: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: 18568 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A258725DF6 for ; Thu, 25 Jul 2013 10:54:47 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf77726vcb.7 for ; Thu, 25 Jul 2013 03:54: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=7L8NBzX8v3XdcRS+cRcqZMAMdCCYdUJWj/t3b99Bskg=; b=kOhHxPoECXT3JFjZ4tvhLqgFlJc5Vj+cQSWNzdmjaZP+EAgI3cdSbuQF9pD/HCtrDV McTCuCTOQ68CfbjdJcA2pN47E7a9ygLx6R6rrL3SxBK35hnXTQ5n62cH8T8ICNzW2xSA DLbZGNNMFPurQDSg3m8HXvD2iV8CAhLawm0s9hIyIqM0AJ/JvVqkqVvY6gTb7O+2FIaJ UNSUV0UHv3J9kejXVQN0FNq6vGNoFzafjyCom3Dfjz508sZvf+272CoAefFH1TtzEbHQ J6CprQ2fmBd7+ACdK3bXmQh34GzAVcA9uW93N7XHyEkhGz17uZt8pRcD+iqqZ0kkEuxn 0hDg== X-Received: by 10.236.190.72 with SMTP id d48mr112873yhn.0.1374749687360; Thu, 25 Jul 2013 03:54:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.15.131 with SMTP id x3ls529055qec.76.gmail; Thu, 25 Jul 2013 03:54:47 -0700 (PDT) X-Received: by 10.52.237.164 with SMTP id vd4mr14513680vdc.118.1374749687277; Thu, 25 Jul 2013 03:54:47 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id xs10si124666vcb.118.2013.07.25.03.54.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 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.169; Received: by mail-ve0-f169.google.com with SMTP id db10so401492veb.0 for ; Thu, 25 Jul 2013 03:54:47 -0700 (PDT) X-Received: by 10.220.83.69 with SMTP id e5mr221746vcl.53.1374749687158; Thu, 25 Jul 2013 03:54: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 yu8csp71177veb; Thu, 25 Jul 2013 03:54:46 -0700 (PDT) X-Received: by 10.66.142.42 with SMTP id rt10mr29749568pab.1.1374749686138; Thu, 25 Jul 2013 03:54:46 -0700 (PDT) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id hs9si934179pbc.334.2013.07.25.03.54.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.160.48; Received: by mail-pb0-f48.google.com with SMTP id md4so605075pbc.35 for ; Thu, 25 Jul 2013 03:54:45 -0700 (PDT) X-Received: by 10.66.227.2 with SMTP id rw2mr7640161pac.131.1374749685763; Thu, 25 Jul 2013 03:54:45 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:45 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Date: Thu, 25 Jul 2013 16:23:59 +0530 Message-Id: <1374749640-30062-11-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: ALoCoQkZrvjLrAJJdowkcaPgPtD2lOM086kTHKTlj72dH2LFK2nhOygO1nS27q9neyQsToEPBFFB X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 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-sm501 glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_sm501_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-sm501.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index d479d5d..2a5de5f 100644 --- a/drivers/usb/host/ohci-sm501.c +++ b/drivers/usb/host/ohci-sm501.c @@ -216,14 +216,21 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev) static int ohci_sm501_suspend(struct platform_device *pdev, pm_message_t msg) { struct device *dev = &pdev->dev; - struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(pdev)); + struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct ohci_hcd *ohci = hcd_to_ohci(hcd); + bool do_wakeup = device_may_wakeup(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; + sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0); - return 0; + return ret; } static int ohci_sm501_resume(struct platform_device *pdev)