From patchwork Thu Jun 13 09:16:21 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: 17879 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 5C31E25BE0 for ; Thu, 13 Jun 2013 09:16:53 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 2sf11176150qea.1 for ; Thu, 13 Jun 2013 02:16:53 -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=YcdkA2XFG9Y89zutcbeECv6jm/fRKqIXDoX8fwbWkI8=; b=T5AguZGyzMuLIF2eG/gvsPMhcagRdbFxah+zTtl1Fo1RNaSIIjny/Jh8HiGbjMUd42 d4WXLyFv3ADHr4mtdNEACpzv1MYORilCYSnKlZYZoeS1kJKcpkUW09JS18XAlhFej7Px EBGlIVGSB6YnzvD5l7nAbH623dAHZODBiuKzZdED/DHNxMsljMXabCdw4AYn0OGwY1mv Zip7V+s3X7aCMh/d13FJ/OYXWRILM3d30xOMbkYp9sCPFQuCMYtBaFDnkzHOXo0nvHak XjgtM9GhKBshdb5n6ZMxUPHHSBe8Qn6Qg8ckVQDwnspNzn27CObIS2fqNMhqEr17I8Se bDUg== X-Received: by 10.224.18.203 with SMTP id x11mr1167467qaa.2.1371115013107; Thu, 13 Jun 2013 02:16:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.51.129 with SMTP id k1ls3265352qeo.47.gmail; Thu, 13 Jun 2013 02:16:53 -0700 (PDT) X-Received: by 10.58.37.165 with SMTP id z5mr532vej.12.1371115012916; Thu, 13 Jun 2013 02:16:52 -0700 (PDT) Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [2607:f8b0:400c:c01::235]) by mx.google.com with ESMTPS id q5si10107661vcw.15.2013.06.13.02.16.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:16:52 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::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:c01::235; Received: by mail-ve0-f181.google.com with SMTP id db10so7378053veb.26 for ; Thu, 13 Jun 2013 02:16:52 -0700 (PDT) X-Received: by 10.52.53.36 with SMTP id y4mr9278207vdo.51.1371115012790; Thu, 13 Jun 2013 02:16: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.191.99 with SMTP id gx3csp13729vec; Thu, 13 Jun 2013 02:16:52 -0700 (PDT) X-Received: by 10.66.232.42 with SMTP id tl10mr1626915pac.159.1371115011825; Thu, 13 Jun 2013 02:16:51 -0700 (PDT) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [2607:f8b0:400e:c03::235]) by mx.google.com with ESMTPS id ye10si13481077pab.154.2013.06.13.02.16.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:16:51 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::235 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::235; Received: by mail-pa0-f53.google.com with SMTP id tj12so5990015pac.40 for ; Thu, 13 Jun 2013 02:16:51 -0700 (PDT) X-Received: by 10.68.101.226 with SMTP id fj2mr36801pbb.6.1371115011424; Thu, 13 Jun 2013 02:16:51 -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.16.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 02:16: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-dev@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH V2 02/10] USB: OHCI: Properly handle ohci-s3c2410 suspend Date: Thu, 13 Jun 2013 14:46:21 +0530 Message-Id: <1371114989-2342-3-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: ALoCoQnY5pJR2u4vQ2DvHU4D7ER91tdQ2a41SYU194fokqnBo7gwhyZ5alEBXupv2cyHKsqG0sg7 X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::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-s3c2410 glue was not properly handled as it was not suspending generic part of ohci controller.Calling explicitly the ohci_suspend() routine in ohci_hcd_s3c2410_drv_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-s3c2410.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 8018bb1..01430f2 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -430,7 +430,15 @@ static int ohci_hcd_s3c2410_drv_suspend(struct device *dev) struct platform_device *pdev = to_platform_device(dev); unsigned long flags; int rc = 0; + bool do_wakeup = device_may_wakeup(dev); + rc = ohci_suspend(hcd, do_wakeup); + if (rc == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) { + ohci_resume(hcd, false); + rc = -EBUSY; + } + if (rc) + return rc; /* * Root hub was already suspended. Disable irq emission and * mark HW unaccessible, bail out if RH has been resumed. Use