From patchwork Wed Jun 19 12:12:08 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: 17985 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f197.google.com (mail-gh0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B20D42397B for ; Wed, 19 Jun 2013 12:12:50 +0000 (UTC) Received: by mail-gh0-f197.google.com with SMTP id r20sf4167525ghr.4 for ; Wed, 19 Jun 2013 05:12:50 -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=0jpkcIg8D6Uo7vniE2eiCMszCQmtZBx+ve6CpPcYKzA=; b=V9hWi1Dsp/3oKq6K0gP9Q2Q8+aRBCqHjpDpWwoRumsIoFhP+Jw6Fq6uzfwNSAvmHpz /8j4b8wqBHHHf5e0ELR6ynunH9pLOPYIdHzrYpWG5HfvW/01vmHUBmr5beMdqxnRpJnF s24G3fw1SfNvMUh6JU/8tNQR8aouw69vx+FoqCKomqLcIGPaw9WlM6BSGEDom0P+jWYJ u8F8Vf3I/m9IXjpLctxVzTvbkEXu+9G+gUKuDKPzEJK0vom9PELf1c6XNrBlF8B061sZ KtZ4zyzFnQxiiBcaEWop9XWlzpE/H3TjFcWynlrd1CAr95rchgmEgLF9C5kip8J7HMCI s4pg== X-Received: by 10.59.6.69 with SMTP id cs5mr207103ved.1.1371643970487; Wed, 19 Jun 2013 05:12:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.38.227 with SMTP id j3ls286647qek.67.gmail; Wed, 19 Jun 2013 05:12:50 -0700 (PDT) X-Received: by 10.52.70.137 with SMTP id m9mr711483vdu.30.1371643970332; Wed, 19 Jun 2013 05:12:50 -0700 (PDT) Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com [2607:f8b0:400c:c01::22a]) by mx.google.com with ESMTPS id ha3si6457657vdb.4.2013.06.19.05.12.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:50 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22a 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::22a; Received: by mail-ve0-f170.google.com with SMTP id 14so4008118vea.29 for ; Wed, 19 Jun 2013 05:12:50 -0700 (PDT) X-Received: by 10.220.110.78 with SMTP id m14mr527123vcp.53.1371643970207; Wed, 19 Jun 2013 05:12:50 -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 yu8csp106214veb; Wed, 19 Jun 2013 05:12:49 -0700 (PDT) X-Received: by 10.68.107.225 with SMTP id hf1mr2499245pbb.130.1371643969136; Wed, 19 Jun 2013 05:12:49 -0700 (PDT) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [2607:f8b0:400e:c03::233]) by mx.google.com with ESMTPS id lo1si1863808pab.209.2013.06.19.05.12.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:49 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::233 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::233; Received: by mail-pa0-f51.google.com with SMTP id lf11so5053269pab.24 for ; Wed, 19 Jun 2013 05:12:48 -0700 (PDT) X-Received: by 10.66.227.35 with SMTP id rx3mr6287495pac.195.1371643968732; Wed, 19 Jun 2013 05:12:48 -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.12.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:48 -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 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Date: Wed, 19 Jun 2013 17:42:08 +0530 Message-Id: <1371643936-3314-4-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: ALoCoQkOOPiS2P0nLqUBfXyuyZ1zxsstLOk/rc1Mm84roRvnhDjh03Sd+yrcawIZ3vJF7BqQu2pU X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22a 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. 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: -rid of unwanted code from ohci_hcd_s3c2410_drv_suspend() which already ohci_suspend() does it. --- drivers/usb/host/ohci-s3c2410.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 8018bb1..70a7ca1 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -428,26 +428,15 @@ static int ohci_hcd_s3c2410_drv_suspend(struct device *dev) struct usb_hcd *hcd = dev_get_drvdata(dev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct platform_device *pdev = to_platform_device(dev); + bool do_wakeup = device_may_wakeup(dev); unsigned long flags; int rc = 0; - /* - * Root hub was already suspended. Disable irq emission and - * mark HW unaccessible, bail out if RH has been resumed. Use - * the spinlock to properly synchronize with possible pending - * RH suspend or resume activity. - */ - spin_lock_irqsave(&ohci->lock, flags); - if (ohci->rh_state != OHCI_RH_SUSPENDED) { - rc = -EINVAL; - goto bail; - } - - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + rc = ohci_suspend(hcd, do_wakeup); + if (rc) + return rc; s3c2410_stop_hc(pdev); -bail: - spin_unlock_irqrestore(&ohci->lock, flags); return rc; }