From patchwork Wed Jun 19 12:12:15 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: 17992 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DBD332397B for ; Wed, 19 Jun 2013 12:13:27 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id c1sf6840317qcz.5 for ; Wed, 19 Jun 2013 05:13:27 -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=MwDx8ezjnItOUcL3G3y5QxNRr9jqAtakWG96Jv1jFIc=; b=H7/UfJu3Olj4BteL5ODw40FXuIEBfwC/Zz+mlJXCWM3lrID/8avUqjOJcv7pBb/jsh KC69MQAK+eanpVFtUdOBkWTxwP7UcqnA7AF3jslgpKHIxARGXXyDEyyj5DSPqTg7Q/gL USsOZYyfms7RuGKEFs00wqs7SN/f1c5Nkv9pgU1oJKqBawetlUWePWoBVMpD6hSsl6Oh 0XLSOVJaQLB9FvLpnnA6LIJiF8n/6ztMkLby+PI6uZOLLYcsR9b0FHgen8OdUEhhqzMO MbQ36VBpxTlNBpsRDz6AaPvhL4TQVtT4nkPQ/I8qQxxLExWXjSfbECWdubSPi7QTFEzt AMUQ== X-Received: by 10.236.226.6 with SMTP id a6mr1426032yhq.35.1371644007683; Wed, 19 Jun 2013 05:13:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.135 with SMTP id u7ls273679qen.3.gmail; Wed, 19 Jun 2013 05:13:27 -0700 (PDT) X-Received: by 10.220.123.131 with SMTP id p3mr524981vcr.69.1371644007555; Wed, 19 Jun 2013 05:13:27 -0700 (PDT) Received: from mail-vb0-x231.google.com (mail-vb0-x231.google.com [2607:f8b0:400c:c02::231]) by mx.google.com with ESMTPS id n7si2317776vcj.80.2013.06.19.05.13.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:27 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::231 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::231; Received: by mail-vb0-f49.google.com with SMTP id 12so3613951vbf.22 for ; Wed, 19 Jun 2013 05:13:27 -0700 (PDT) X-Received: by 10.58.215.200 with SMTP id ok8mr856044vec.21.1371644007415; Wed, 19 Jun 2013 05:13:27 -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 yu8csp106246veb; Wed, 19 Jun 2013 05:13:26 -0700 (PDT) X-Received: by 10.66.219.103 with SMTP id pn7mr6429148pac.123.1371644006301; Wed, 19 Jun 2013 05:13:26 -0700 (PDT) Received: from mail-pb0-x232.google.com (mail-pb0-x232.google.com [2607:f8b0:400e:c01::232]) by mx.google.com with ESMTPS id ph3si8031203pbc.74.2013.06.19.05.13.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:26 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::232 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::232; Received: by mail-pb0-f50.google.com with SMTP id wz7so5028169pbc.37 for ; Wed, 19 Jun 2013 05:13:25 -0700 (PDT) X-Received: by 10.66.240.41 with SMTP id vx9mr6419921pac.93.1371644005923; Wed, 19 Jun 2013 05:13:25 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id e2sm22925142pbc.23.2013.06.19.05.13.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:25 -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 V3 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Date: Wed, 19 Jun 2013 17:42:15 +0530 Message-Id: <1371643936-3314-11-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQmjP/rx80bZjFdjBoaEOPM3pNiJw2YnuDbF5AQfUOG3UCEylas518LLk7feMjkoeTuzALSs X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::231 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 Cc: Arnd Bergmann Cc: Alan Stern 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". --- 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..e6c8db6 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)