From patchwork Tue Jun 25 06:39:45 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: 18098 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1EF8425D00 for ; Tue, 25 Jun 2013 06:41:04 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b12sf17388360yha.0 for ; Mon, 24 Jun 2013 23:41:03 -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=nH2aBp6kqtD/7ALtb6UFFp7J5kncJMCEVNmGfc0BJO2QG39ErBm3ktG8QMnpLes5K9 a5dOvu9sBfpx0zf0aCVlHyFmrPZ46ld17PO1pDFJ005IQVoNiMxvrICMREmNvDV15PC1 AYsCNub11BbIzJW066uas3OHKVPR56rzqVQVmR1FLNc3LO86+lajwHwFqOyiPWyP8mDO evJJ4WSjvRivRk8VSRIa7ietfdZygWO+WZ6zMT4Hh+tttDSk8EHd6fCZC7v+RZO7l/IN 8E6HZRQgmlmY4u2oeEYvUoyeh+8ZQ/l6z6ZNewkhu/RLKhPCMjafY6OwEW1wppbOvCC/ LcPQ== X-Received: by 10.236.201.19 with SMTP id a19mr14866033yho.24.1372142463934; Mon, 24 Jun 2013 23:41:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.4 with SMTP id m4ls2366581qeq.52.gmail; Mon, 24 Jun 2013 23:41:03 -0700 (PDT) X-Received: by 10.220.250.147 with SMTP id mo19mr13063680vcb.79.1372142463710; Mon, 24 Jun 2013 23:41:03 -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 kj9si5883546veb.69.2013.06.24.23.41.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:41:03 -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 p12so8890434vbe.26 for ; Mon, 24 Jun 2013 23:41:03 -0700 (PDT) X-Received: by 10.220.203.197 with SMTP id fj5mr2143371vcb.60.1372142463628; Mon, 24 Jun 2013 23:41:03 -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 yu8csp55578veb; Mon, 24 Jun 2013 23:41:03 -0700 (PDT) X-Received: by 10.68.1.226 with SMTP id 2mr27363562pbp.150.1372142462652; Mon, 24 Jun 2013 23:41:02 -0700 (PDT) Received: from mail-pd0-x22f.google.com (mail-pd0-x22f.google.com [2607:f8b0:400e:c02::22f]) by mx.google.com with ESMTPS id iw6si10921084pac.43.2013.06.24.23.41.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:41:02 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c02::22f is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c02::22f; Received: by mail-pd0-f175.google.com with SMTP id 4so801270pdd.34 for ; Mon, 24 Jun 2013 23:41:02 -0700 (PDT) X-Received: by 10.68.167.99 with SMTP id zn3mr27345034pbb.216.1372142462282; Mon, 24 Jun 2013 23:41:02 -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.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:41:01 -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 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Date: Tue, 25 Jun 2013 12:09:45 +0530 Message-Id: <1372142386-10691-11-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: ALoCoQmfaxbX2zZPTlHUwnH9CQHpZLIBh9F5BKU8E8R/tE5VR74kMIEFDMsx3djF4qOdYw1D9HBp 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-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)