From patchwork Tue Jun 25 06:39:36 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: 18089 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5537325D00 for ; Tue, 25 Jun 2013 06:40:16 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id f14sf725706qak.7 for ; Mon, 24 Jun 2013 23:40:16 -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=T+CP/MsfSkcqDJLIa7R/+iyA9ilCPHRpHTxohO+vZg8=; b=Po4InT17WsjMKBq9GeXlA3GHLZCNIe1F5ZrjgzckhlJ9fNPcHVQBOD/1OtXDNDSHd/ nfXHuHaxgJBQ6dOhfSNdtvxaiflUDnxm4bqvpF1Spd7OyLndUOrLhzROOq0HuDVkMT/G RITZyjkCjdwngW/yb6vYc30m6r+XodORkDCsvTvgtB6CbOruhZFXsnKvSihqA+5bKnOG sh2AV89x0Hbpof4dVb63qXFmrX8r5yG2UFg5oyMyqlJFRCJurni/rcHWvNP0l2CAW2d4 BVy19EzajnJyx5orfyKx18dxf/yV58Q6eMLa+Avj9ZQSv8kNJ53Gsj7VeDbTEucu/40b tkYA== X-Received: by 10.236.133.19 with SMTP id p19mr15547798yhi.54.1372142415850; Mon, 24 Jun 2013 23:40:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.18.196 with SMTP id y4ls2323003qed.38.gmail; Mon, 24 Jun 2013 23:40:15 -0700 (PDT) X-Received: by 10.58.108.8 with SMTP id hg8mr13491501veb.6.1372142415655; Mon, 24 Jun 2013 23:40:15 -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 ia10si5881685vdb.77.2013.06.24.23.40.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:15 -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 q12so9070294vbe.27 for ; Mon, 24 Jun 2013 23:40:15 -0700 (PDT) X-Received: by 10.220.110.78 with SMTP id m14mr13183549vcp.53.1372142415554; Mon, 24 Jun 2013 23:40:15 -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 yu8csp55556veb; Mon, 24 Jun 2013 23:40:14 -0700 (PDT) X-Received: by 10.66.48.201 with SMTP id o9mr13630292pan.76.1372142414384; Mon, 24 Jun 2013 23:40:14 -0700 (PDT) Received: from mail-pd0-x232.google.com (mail-pd0-x232.google.com [2607:f8b0:400e:c02::232]) by mx.google.com with ESMTPS id sb1si10590122pbb.292.2013.06.24.23.40.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:14 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c02::232 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c02::232; Received: by mail-pd0-f178.google.com with SMTP id w11so804011pde.37 for ; Mon, 24 Jun 2013 23:40:14 -0700 (PDT) X-Received: by 10.66.160.1 with SMTP id xg1mr31106599pab.25.1372142413981; Mon, 24 Jun 2013 23:40:13 -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.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:13 -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 01/11] USB: OHCI: Properly handle OHCI controller suspend Date: Tue, 25 Jun 2013 12:09:36 +0530 Message-Id: <1372142386-10691-2-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: ALoCoQmOS9t4mOpVaRETuaVIWgXcIGeUnyUixTpHxTpsLeZ5Fmc74IJV+CfDawyC4mBIWg7B0o0Z 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 was not properly handled in ochi_suspend()routine. This does 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 V3: New patch. V4: No change. --- 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);