From patchwork Wed Jun 19 12:12:06 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: 17983 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E49A52397B for ; Wed, 19 Jun 2013 12:12:39 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id hu16sf867401qab.4 for ; Wed, 19 Jun 2013 05:12:39 -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=VIoArw8z2FZ3LQBtPV2kI+ramppxRC9Jssfg0nOvqiQ=; b=BHOyKqcJyysvavewU7ld2EUUSQQ4xP3HZ3n0iSIavJTqCSd9xaHqsRxNX7DoJEjfFs SGJuRBMnaBdi+EVAXFMEpc8sCe1J8SHPj8/nqiJ/QrUS7Qywz7mdD2isYPxZ7rmJzOyi LyE1rvNpEUdf2rQGCDs/dOHJYI3FYnAoyO9VcbMk42bH4XpnXKtH69pZfLYpI1F40lOZ ZdB9a+lKgryetnVxfRx3ouEExWXhncPg9eQkpg5EiU7cbVBZwI72QI/9X/cfB5ksvZpb 21xU8D8P6OoMA7gS+otv6fBgDZ/bM4g5y43c1eEfICQE/3xM8HcIZPbpfDCslYBA+Rit PmDA== X-Received: by 10.58.188.15 with SMTP id fw15mr301047vec.9.1371643959694; Wed, 19 Jun 2013 05:12:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.96.233 with SMTP id dv9ls231016qeb.81.gmail; Wed, 19 Jun 2013 05:12:39 -0700 (PDT) X-Received: by 10.52.120.7 with SMTP id ky7mr717941vdb.12.1371643959553; Wed, 19 Jun 2013 05:12:39 -0700 (PDT) Received: from mail-ve0-x233.google.com (mail-ve0-x233.google.com [2607:f8b0:400c:c01::233]) by mx.google.com with ESMTPS id og3si6458338vcb.6.2013.06.19.05.12.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:39 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::233 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::233; Received: by mail-ve0-f179.google.com with SMTP id d10so3975992vea.10 for ; Wed, 19 Jun 2013 05:12:39 -0700 (PDT) X-Received: by 10.52.22.174 with SMTP id e14mr719366vdf.21.1371643959439; Wed, 19 Jun 2013 05:12:39 -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 yu8csp106206veb; Wed, 19 Jun 2013 05:12:38 -0700 (PDT) X-Received: by 10.66.145.2 with SMTP id sq2mr6410149pab.2.1371643958499; Wed, 19 Jun 2013 05:12:38 -0700 (PDT) Received: from mail-pb0-x22a.google.com (mail-pb0-x22a.google.com [2607:f8b0:400e:c01::22a]) by mx.google.com with ESMTPS id wx5si10766050pbc.53.2013.06.19.05.12.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:38 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22a is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c01::22a; Received: by mail-pb0-f42.google.com with SMTP id un1so5014082pbc.1 for ; Wed, 19 Jun 2013 05:12:38 -0700 (PDT) X-Received: by 10.66.135.18 with SMTP id po18mr6615444pab.1.1371643958108; Wed, 19 Jun 2013 05:12:38 -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.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:12:37 -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 01/11] USB: OHCI: Properly handle OHCI controller suspend Date: Wed, 19 Jun 2013 17:42:06 +0530 Message-Id: <1371643936-3314-2-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: ALoCoQns11VX0JMG5nNiheHLHBSbmkRtQw0F5ju1DEO7dM8n/AMhD35oHsqAxSboPWoWYY7s443x X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::233 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 was not properly handled in ochi_suspend()routine. This does 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 V3: New patch. --- drivers/usb/host/ohci-hcd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index b69a49e..f3dcaa2 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1034,6 +1034,7 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) { struct ohci_hcd *ohci = hcd_to_ohci (hcd); unsigned long flags; + int rc = 0; /* Disable irq emission and mark HW unaccessible. Use * the spinlock to properly synchronize with possible pending @@ -1046,7 +1047,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); spin_unlock_irqrestore (&ohci->lock, flags); - return 0; + synchronize_irq(hcd->irq); + + if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) { + ohci_resume(hcd, false); + rc = -EBUSY; + } + return rc; } EXPORT_SYMBOL_GPL(ohci_suspend);