From patchwork Mon Jul 22 09:32: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: 18478 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4286225E1F for ; Mon, 22 Jul 2013 09:33:53 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id a11sf8687101qen.8 for ; Mon, 22 Jul 2013 02:33:52 -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=G5aH4UTkr/n59Zty1Bi6JnF56cvDiJl4imjJ58Yv9OBYb4QCv1YFSw2osv8hfvNpww F+VDE08/3q/cJOKE87oraaYBYpsuf8lT4I3gM1XLAZt+DauP5ucqCJESwZ7nK4gOnsJF moBPN7PbKQveRFGBfseKLM90N/KkjEWgHyzukuW839AM+RGdzLab4UIegAOnkZkPzWyF xsyAxXVu0DvmlJEM+IFcXP6GvLuF7DC0bNSjEJopFwqP6RBvLHM+9oZL1Kfls5XWKyhN Zse8/+NJl5sTlrZ7/HzkuqeVCqq/kIhBQSbrie7+PDeknpc4qVRrDwYmWTBRrMwcU2tD GzuA== X-Received: by 10.236.15.73 with SMTP id e49mr15292046yhe.15.1374485632907; Mon, 22 Jul 2013 02:33:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.3 with SMTP id l3ls2692720qek.62.gmail; Mon, 22 Jul 2013 02:33:52 -0700 (PDT) X-Received: by 10.52.163.46 with SMTP id yf14mr7502884vdb.58.1374485632806; Mon, 22 Jul 2013 02:33:52 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id op1si6838796vcb.90.2013.07.22.02.33.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 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.44; Received: by mail-vb0-f44.google.com with SMTP id e15so4639908vbg.17 for ; Mon, 22 Jul 2013 02:33:52 -0700 (PDT) X-Received: by 10.58.119.233 with SMTP id kx9mr9211210veb.3.1374485632461; Mon, 22 Jul 2013 02:33:52 -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 yu8csp46459veb; Mon, 22 Jul 2013 02:33:51 -0700 (PDT) X-Received: by 10.68.232.97 with SMTP id tn1mr26571484pbc.36.1374485631387; Mon, 22 Jul 2013 02:33:51 -0700 (PDT) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by mx.google.com with ESMTPS id tw4si18140428pbc.331.2013.07.22.02.33.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.42 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.220.42; Received: by mail-pa0-f42.google.com with SMTP id rl6so6870675pac.29 for ; Mon, 22 Jul 2013 02:33:51 -0700 (PDT) X-Received: by 10.67.12.175 with SMTP id er15mr30300491pad.31.1374485630995; Mon, 22 Jul 2013 02:33:50 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.229]) by mx.google.com with ESMTPSA id bb1sm24977759pbc.10.2013.07.22.02.33.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:50 -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 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Date: Mon, 22 Jul 2013 15:02:45 +0530 Message-Id: <1374485566-3997-11-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: ALoCoQnQMoxkQ3Yso+iRsD3g7fNL3j1RZiezYugxREp3TDi7bg9SWGul975zte/ZfvCkVeRBcu/D X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 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)