From patchwork Thu Jun 20 09:35:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manjunath Goudar X-Patchwork-Id: 2754151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 62AC39F39E for ; Thu, 20 Jun 2013 09:39:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD9DC20448 for ; Thu, 20 Jun 2013 09:39:45 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B4F420450 for ; Thu, 20 Jun 2013 09:39:44 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpbJg-0003pk-Gt; Thu, 20 Jun 2013 09:38:10 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpbJ1-0000TM-Jb; Thu, 20 Jun 2013 09:37:27 +0000 Received: from mail-pd0-f170.google.com ([209.85.192.170]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpbIc-0000OX-0J for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2013 09:37:04 +0000 Received: by mail-pd0-f170.google.com with SMTP id x11so6059484pdj.1 for ; Thu, 20 Jun 2013 02:36:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=B4PfWFLFz38v7iU6aJiXW8GHSvWpL7G86y6o8kgBNYo=; b=XVbAr2DnhcqKPt+pfNf5wiwZSKVsdMFn0/5ZIZBxJFNYN0JPw58hpcSfzKfqkrg1mS Ck9aKwNvizOs69bFVjjQDZTEQAVhVOXM6j7utILB2RPMNFl7Z5ZvpPpQ4Tg5A0Fu0dxg HOvqqWrLIAbbNwxBvgw2eyzcL0XW6dJD+adL10l1NCD7QSVCnP+ftZp82u4kE+c7QSch amY0ZZ8QwgMxSuPUuVLGaBVQfvhLhxJQE503OFizSE6JdHUoR2m0CxvFUCmQ8+Ogf6gd hBY9Rpfcze9EwPscBXTD1pl8Idy1cPQe4/9qzuIpC/RmGW6P0dfvBKrGTjHDbh/Uz+nb 9Qyg== X-Received: by 10.68.180.4 with SMTP id dk4mr6652872pbc.104.1371721000529; Thu, 20 Jun 2013 02:36:40 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.192]) by mx.google.com with ESMTPSA id kq2sm35530pab.19.2013.06.20.02.36.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:36:39 -0700 (PDT) From: Manjunath Goudar To: linux-usb@vger.kernel.org Subject: [PATCH V4 01/11] USB: OHCI: Properly handle OHCI controller suspend Date: Thu, 20 Jun 2013 15:05:57 +0530 Message-Id: <1371720968-7533-2-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQnfsiWIkYUnqr/Su/QkU5pQunVekDaUIYdovXzfOQ4fq01PyrZ/TSBVYl4rMkhB8CrBoDxt X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130620_053702_194021_E4C7175D X-CRM114-Status: GOOD ( 12.02 ) X-Spam-Score: -1.9 (-) Cc: linaro-kernel@lists.linaro.org, Arnd Bergmann , patches@linaro.org, Greg KH , manjunath.goudar@linaro.org, stern@rowland.harvard.edu, arnd@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. 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);