From patchwork Thu Jun 13 09:16:26 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: 17884 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DA19E25BE0 for ; Thu, 13 Jun 2013 09:17:17 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 2sf11176478qea.1 for ; Thu, 13 Jun 2013 02:17:17 -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=U6p7ZPYI3i/gmAVzM33xNksWiSzn+LIDlPFBcOV9WNE=; b=I26nKTXr3AX7XrB1LpkZ/X/oMNQ0S/wBqm8d7Lpgxt1AtpCcAe6SpKB4sNICmY2Web mIRXjCXzgtmN1LFYSFGqvQqiDAbXWsf8BWgju0+M40YBogUzfXVNJjnRg62YdJbTpEDj PesfwSJxpXN3iqu4cZjYM1TjWgyH01Zsr+LEpGjtGofClz15DeWrZ0OV8SsAzzvj1tk7 GNzTBuJKDNoq6btzYPBuAzFAm59UVbJfHIQGG6zjDYzTZdJvrmovWM1SEBCvkbjAVyXe wU2AvNQkVZBiDLoiFWbRglcxvH/aKpnMwH6fD3K4Uk2yRTtOkBJ+oVEd7hFCSJ4MGpqS ZRiQ== X-Received: by 10.224.215.68 with SMTP id hd4mr1162260qab.5.1371115037580; Thu, 13 Jun 2013 02:17:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.15.131 with SMTP id x3ls1780035qec.76.gmail; Thu, 13 Jun 2013 02:17:17 -0700 (PDT) X-Received: by 10.52.17.203 with SMTP id q11mr9486703vdd.120.1371115037446; Thu, 13 Jun 2013 02:17:17 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id ia10si10081853vdb.129.2013.06.13.02.17.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so4842584vcb.25 for ; Thu, 13 Jun 2013 02:17:17 -0700 (PDT) X-Received: by 10.220.185.136 with SMTP id co8mr11109745vcb.25.1371115037323; Thu, 13 Jun 2013 02:17:17 -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.191.99 with SMTP id gx3csp13741vec; Thu, 13 Jun 2013 02:17:16 -0700 (PDT) X-Received: by 10.66.252.67 with SMTP id zq3mr1881003pac.186.1371115036326; Thu, 13 Jun 2013 02:17:16 -0700 (PDT) Received: from mail-pb0-x233.google.com (mail-pb0-x233.google.com [2607:f8b0:400e:c01::233]) by mx.google.com with ESMTPS id o4si13503579pac.18.2013.06.13.02.17.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:16 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::233 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::233; Received: by mail-pb0-f51.google.com with SMTP id um15so10051459pbc.24 for ; Thu, 13 Jun 2013 02:17:16 -0700 (PDT) X-Received: by 10.66.155.199 with SMTP id vy7mr1972613pab.69.1371115035936; Thu, 13 Jun 2013 02:17:15 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id dc3sm22602113pbc.9.2013.06.13.02.17.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:17:15 -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-dev@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH V2 07/10] USB: OHCI: Properly handle ohci-platform suspend Date: Thu, 13 Jun 2013 14:46:26 +0530 Message-Id: <1371114989-2342-8-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371114989-2342-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371114989-2342-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQnf1tZyPVe8Qq/1A1c09t9zMuyv0YbXGCm2AG/t2wmh0DOYVr0o2f5xBgFLudCMtTHFexxB X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 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-platform glue was not properly handled as it was not suspending generic part of ohci controller.Calling explicitly the ohci_suspend() routine in ohci_platform_suspend() will ensure proper handling of suspend scenario. V2: -Incase ohci_suspend() fails, return right away without executing further. Signed-off-by: Manjunath Goudar Cc: Arnd Bergmann Cc: Alan Stern Cc: Greg KH Cc: linux-usb@vger.kernel.org --- drivers/usb/host/ohci-platform.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index bc30475..f91201b 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -139,14 +139,25 @@ static int ohci_platform_remove(struct platform_device *dev) static int ohci_platform_suspend(struct device *dev) { + struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ohci_pdata *pdata = dev->platform_data; struct platform_device *pdev = container_of(dev, struct platform_device, dev); + bool do_wakeup = device_may_wakeup(dev); + int ret; + + ret = ohci_suspend(hcd, do_wakeup); + if (ret == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) { + ohci_resume(hcd, false); + ret = -EBUSY; + } + if (ret) + return ret; if (pdata->power_suspend) pdata->power_suspend(pdev); - return 0; + return ret; } static int ohci_platform_resume(struct device *dev)