From patchwork Thu Jun 20 09:36:00 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: 18007 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A8A2C2393D for ; Thu, 20 Jun 2013 09:38:00 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf8570198yhz.7 for ; Thu, 20 Jun 2013 02:38:00 -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=QYj+lLIsZhVhMgyAeHbJKRR2c/gvWrfAxDiJojChXYE=; b=HQv28FfO9sxDYFCMqHCIK/71tNKuikchKoQp4iWz24LGzw8oVfnPam7nxrDZFHze/5 4chrtzjUvM7DhPj9CGLL4U3rVhcl6qa4hMwAdTBjUdgiaIAFTxujx1gyH2M7WwshqrOR yqVipuWQ+5Ii+qlfp0+JnKVIaLEUDnoadb7iyc6HVnT4faBREqglMR1tpspVc0M2iS0C 98YdrhDiQFSb6u75ddjG+sq3t28VV3ANxo2ffsZUZ3IYcLs/zZTz9HJAdprzyUILzpKj GBaOXF+3X5ryDY27oybwIq/VRAu+1es+V3NYavSiXLdvXSZJ6ZRO0aII4HTe9bLvDvur aMEw== X-Received: by 10.236.139.134 with SMTP id c6mr4030337yhj.7.1371721080185; Thu, 20 Jun 2013 02:38:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.96.35 with SMTP id dp3ls597931qeb.87.gmail; Thu, 20 Jun 2013 02:38:00 -0700 (PDT) X-Received: by 10.58.219.232 with SMTP id pr8mr2567391vec.80.1371721080053; Thu, 20 Jun 2013 02:38:00 -0700 (PDT) Received: from mail-ve0-x22d.google.com (mail-ve0-x22d.google.com [2607:f8b0:400c:c01::22d]) by mx.google.com with ESMTPS id ot8si6558540vcb.147.2013.06.20.02.38.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:00 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22d 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:c01::22d; Received: by mail-ve0-f173.google.com with SMTP id jw11so4887578veb.32 for ; Thu, 20 Jun 2013 02:38:00 -0700 (PDT) X-Received: by 10.52.95.113 with SMTP id dj17mr2161419vdb.82.1371721079930; Thu, 20 Jun 2013 02:37:59 -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 yu8csp13829veb; Thu, 20 Jun 2013 02:37:59 -0700 (PDT) X-Received: by 10.68.182.33 with SMTP id eb1mr6767834pbc.186.1371721078729; Thu, 20 Jun 2013 02:37:58 -0700 (PDT) Received: from mail-pb0-x22e.google.com (mail-pb0-x22e.google.com [2607:f8b0:400e:c01::22e]) by mx.google.com with ESMTPS id pn6si13109175pbb.141.2013.06.20.02.37.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:37:58 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22e is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::22e; Received: by mail-pb0-f46.google.com with SMTP id rq2so6035769pbb.33 for ; Thu, 20 Jun 2013 02:37:58 -0700 (PDT) X-Received: by 10.66.7.164 with SMTP id k4mr10708570paa.142.1371721078322; Thu, 20 Jun 2013 02:37:58 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.192]) by mx.google.com with ESMTPSA id kq2sm35530pab.19.2013.06.20.02.37.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:37:57 -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 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Date: Thu, 20 Jun 2013 15:06:00 +0530 Message-Id: <1371720968-7533-5-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQkbJapyz0R5dYbS3EBPOP26HV5ahTO7/RWnaRNtiokBmDObZ5sah7lhHAC4atR04palpp41 X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22d 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-da8xx glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_da8xx_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". -pdev->dev.power.power_state stuff has been removed. V4: -Properly aligned "do_wakeup" and "ret" variable. --- drivers/usb/host/ohci-da8xx.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 6aaa9c9..44893cf 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -406,19 +406,26 @@ static int ohci_hcd_da8xx_drv_remove(struct platform_device *dev) } #ifdef CONFIG_PM -static int ohci_da8xx_suspend(struct platform_device *dev, pm_message_t message) +static int ohci_da8xx_suspend(struct platform_device *pdev, + pm_message_t message) { - struct usb_hcd *hcd = platform_get_drvdata(dev); + 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; + ohci_da8xx_clock(0); hcd->state = HC_STATE_SUSPENDED; - dev->dev.power.power_state = PMSG_SUSPEND; - return 0; + + return ret; } static int ohci_da8xx_resume(struct platform_device *dev)