From patchwork Tue Jun 25 06:39:38 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: 18091 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6A03825D00 for ; Tue, 25 Jun 2013 06:40:26 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q4sf1020200yen.0 for ; Mon, 24 Jun 2013 23:40:26 -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=ehiBCi/r+SBK/+MIwPZvewEIH0DEMlsvu5we45vzPPE=; b=RU16XV9qU47OQGeh3d0vE9ZI3M/Ds7EZFFsLkugrIi8bNXCwwahvkz+HFwWNBdON5W rZ8N4M2G4gmPuLtus8S451LHbzdBNj6USypTnGA9NxJeH1ViqpYh46h+q6gfR891YDtq wXA1QrSKpumf61epBZTKo3+vXyo4MUvoovvl7YLCwU45SPynXNx7kjkV51wEULwTEsfB zs7p1lH7g8O2k8vIFgqNbm8DAP6v/8YWWynQcFKpZ0AW2Bkh5rMh3m0Qh+Yk7OQoc1xL GzzlrzzQn7w3x1dOh92wSmBGZZ2c6Gt6J2ZFN/EBGpiKiwQbfnknX04HTtak608cntWJ o1jA== X-Received: by 10.236.41.103 with SMTP id g67mr10956891yhb.45.1372142426240; Mon, 24 Jun 2013 23:40:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.210 with SMTP id x18ls2384170qeu.85.gmail; Mon, 24 Jun 2013 23:40:26 -0700 (PDT) X-Received: by 10.58.233.173 with SMTP id tx13mr13480941vec.31.1372142426088; Mon, 24 Jun 2013 23:40:26 -0700 (PDT) Received: from mail-vb0-x236.google.com (mail-vb0-x236.google.com [2607:f8b0:400c:c02::236]) by mx.google.com with ESMTPS id fb8si5873644vcb.108.2013.06.24.23.40.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:26 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::236 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:c02::236; Received: by mail-vb0-f54.google.com with SMTP id q12so9141386vbe.13 for ; Mon, 24 Jun 2013 23:40:26 -0700 (PDT) X-Received: by 10.58.251.144 with SMTP id zk16mr13181219vec.37.1372142425988; Mon, 24 Jun 2013 23:40:25 -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 yu8csp55558veb; Mon, 24 Jun 2013 23:40:25 -0700 (PDT) X-Received: by 10.68.217.137 with SMTP id oy9mr5292709pbc.130.1372142424930; Mon, 24 Jun 2013 23:40:24 -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 eh5si10907519pac.115.2013.06.24.23.40.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:24 -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 lf11so12123314pab.10 for ; Mon, 24 Jun 2013 23:40:24 -0700 (PDT) X-Received: by 10.66.228.98 with SMTP id sh2mr30276611pac.80.1372142424529; Mon, 24 Jun 2013 23:40:24 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id mr3sm6037160pbb.27.2013.06.24.23.40.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:23 -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 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Date: Tue, 25 Jun 2013 12:09:38 +0530 Message-Id: <1372142386-10691-4-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQkuRz5W6vqeV0sPZOQoC3TNplca6xjFCwKok19FT2W286A8KsEjsWwkOh0KMGtqLTQkcIVQ X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::236 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 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: -rid of unwanted code from ohci_hcd_s3c2410_drv_suspend() which already ohci_suspend() does it. V4: -The do_wakeup variable alignment is removed. --- 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 b0f6644..4189aaa 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -427,26 +427,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; }