From patchwork Thu Oct 3 13:02:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Majunath Goudar X-Patchwork-Id: 2982711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 89953BFF0B for ; Thu, 3 Oct 2013 13:03:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AFF25202E8 for ; Thu, 3 Oct 2013 13:03:47 +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 12667202B4 for ; Thu, 3 Oct 2013 13:03:46 +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 1VRiYr-0006fE-5h; Thu, 03 Oct 2013 13:03:21 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRiYh-00022d-D3; Thu, 03 Oct 2013 13:03:11 +0000 Received: from mail-pb0-x233.google.com ([2607:f8b0:400e:c01::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRiYT-0001zi-3Y for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2013 13:02:58 +0000 Received: by mail-pb0-f51.google.com with SMTP id jt11so2422913pbb.24 for ; Thu, 03 Oct 2013 06:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zGsDJ5ql1+P0SO91BaOnxnnPmVeSUttxYyFF3dUG6sM=; b=wyKdwrSKzJzOHaw585I/+pj+PKqIllWmVid2hxcA5Tz2/HQ4dRR0zvS1iWdWQuwM0Y cT7auFg+Pi/ZkdFb8OifV95tnm3UU7AmVoL/BfZuUOs7ZN++jelPO7mlGcmUxCvZNeN/ IGNnflk1s/nuXPixPGeLSf2oCTJZe2exdX3HKtoJ2/fNBVmFsCl9yY3SsHBCRwvayvOq GNVMenUwIjnb3GrqtoDy08jthZiVFw4wZX/tqn0ygi2d+oazXeS9sBctdEc+mwLcQyA+ kybcspvAOaiJU9ntRYxCyhBkiJECV+Ihxidd0QIVkp7KhCS2E8hqlLdUdGOoJpCa4MjS NKKQ== X-Received: by 10.67.5.132 with SMTP id cm4mr2024036pad.186.1380805355326; Thu, 03 Oct 2013 06:02:35 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id ed3sm8176746pbc.6.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 06:02:34 -0700 (PDT) From: Majunath Goudar To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 01/11] USB: OHCI: Properly handle OHCI controller suspend Date: Thu, 3 Oct 2013 18:32:03 +0530 Message-Id: <1380805334-19934-2-git-send-email-csmanjuvijay@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1380805334-19934-1-git-send-email-csmanjuvijay@gmail.com> References: <1380708947-15966-1-git-send-email-csmanjuvijay@gmail.com> <1380805334-19934-1-git-send-email-csmanjuvijay@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131003_090257_258665_2593DDA5 X-CRM114-Status: GOOD ( 13.12 ) X-Spam-Score: 0.1 (/) Cc: Manjunath Goudar , Arnd Bergmann , Greg KH , Manjunath Goudar , linux-usb@vger.kernel.org, Manjunath Goudar , Alan Stern , nataraja.km@lge.com 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=-2.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 From: Manjunath Goudar Suspend scenario in case of OHCI was not properly handled in ochi_suspend()routine. Alan Stern suggested, properly handle OHCI suspend scenario. This does generic proper handling of suspend scenario to all OHCI SOC. Signed-off-by: Manjunath Goudar Signed-off-by: Manjunath Goudar Cc: Alan Stern Cc: Arnd Bergmann Cc: Greg KH Cc: linux-usb@vger.kernel.org --- drivers/usb/host/ohci-hcd.c | 11 +++++++++-- drivers/usb/host/ohci.h | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 8ada13f..46087a1 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1032,10 +1032,11 @@ EXPORT_SYMBOL_GPL(ohci_restart); #ifdef CONFIG_PM -int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) +int ohci_suspend(struct usb_hcd *hcd) { 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 @@ -1048,7 +1049,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 (HCD_WAKEUP_PENDING(hcd)) { + ohci_resume(hcd, false); + rc = -EBUSY; + } + return rc; } EXPORT_SYMBOL_GPL(ohci_suspend); diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index e2e5faa..f2ebd423 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -735,6 +735,6 @@ extern void ohci_init_driver(struct hc_driver *drv, extern int ohci_restart(struct ohci_hcd *ohci); extern int ohci_setup(struct usb_hcd *hcd); #ifdef CONFIG_PM -extern int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup); +extern int ohci_suspend(struct usb_hcd *hcd); extern int ohci_resume(struct usb_hcd *hcd, bool hibernated); #endif