From patchwork Wed Nov 13 12:10:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Majunath Goudar X-Patchwork-Id: 3178011 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 03D859F3A0 for ; Wed, 13 Nov 2013 12:12:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9EEB20125 for ; Wed, 13 Nov 2013 12:12:43 +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 0773320111 for ; Wed, 13 Nov 2013 12:12:39 +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 1VgZIH-0005DP-Pl; Wed, 13 Nov 2013 12:11:38 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgZI4-0006Os-7f; Wed, 13 Nov 2013 12:11:24 +0000 Received: from mail-pb0-x232.google.com ([2607:f8b0:400e:c01::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgZHm-0006MO-VC for linux-arm-kernel@lists.infradead.org; Wed, 13 Nov 2013 12:11:08 +0000 Received: by mail-pb0-f50.google.com with SMTP id xb12so331930pbc.9 for ; Wed, 13 Nov 2013 04:10:45 -0800 (PST) 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=LZcFIiobXZEhy0udOpYBgxsYfE+D7d8HJLzb5KKcS28=; b=tZB9Vrvi8/C2RCTkxMBV+36KMNo39jwD+xWQoUFbDBKn3vuAB7bAVUqy0rEM5x20vm iQmwSvlghw3Nc3rHQ6eFPhtph8KKDz1rdT2NLXdzvFFbYDo+TOf98EAUIuSzxjYcaTsy UOCOlLd3pbV0Ezk1ktSZT5merZ8lFtwBzL2TfKi1Ma2D8Kv+e7kBNmm0u41o7XchGmZy QmmYAMxWhq/3/Icmw0nkWxQL3MYxcD9UEEkn9P+to9sxvW8yNWUxz8dTVLTA2t9wGWLB sBBwCAaqgYf/y8TmzR6r733c7ABaDynehpGgWjRrTegNTptd9qYRJhpy++yQGxQQhnos 3ffQ== X-Received: by 10.66.102.39 with SMTP id fl7mr5208445pab.43.1384344645475; Wed, 13 Nov 2013 04:10:45 -0800 (PST) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id qf7sm51287959pac.14.2013.11.13.04.10.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Nov 2013 04:10:44 -0800 (PST) From: Majunath Goudar To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/6] USB: OHCI: Properly handle ohci-at91 suspend Date: Wed, 13 Nov 2013 17:40:17 +0530 Message-Id: <1384344621-6981-3-git-send-email-csmanjuvijay@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1384344621-6981-1-git-send-email-csmanjuvijay@gmail.com> References: <1380708947-15966-1-git-send-email-csmanjuvijay@gmail.com> <1384344621-6981-1-git-send-email-csmanjuvijay@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131113_071107_139726_F496760D X-CRM114-Status: GOOD ( 13.75 ) X-Spam-Score: 0.1 (/) Cc: Greg KH , nataraja.km@lge.com, Majunath Goudar , linux-usb@vger.kernel.org, Arnd Bergmann 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.0 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 Suspend scenario in case of ohci-at91 glue was not properly handled as it was not suspending generic part of ohci controller. Alan Stern suggested, properly handle ohci-at91 suspend scenario. Calling explicitly the ohci_suspend() routine in ohci_hcd_at91_drv_suspend() will ensure proper handling of suspend scenario. This task is sugested by Alan Stern. Signed-off-by: Manjunath Goudar Acked-by: Alan Stern Cc: Arnd Bergmann Cc: Greg KH Cc: linux-usb@vger.kernel.org --- drivers/usb/host/ohci-at91.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 476b5a5..71eff0b 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -636,10 +636,17 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); + bool do_wakeup = device_may_wakeup(&pdev->dev); + int ret; - if (device_may_wakeup(&pdev->dev)) + if (do_wakeup) enable_irq_wake(hcd->irq); + ret = ohci_suspend(hcd, do_wakeup); + if (ret) { + disable_irq_wake(hcd->irq); + return ret; + } /* * The integrated transceivers seem unable to notice disconnect, * reconnect, or wakeup without the 48 MHz clock active. so for @@ -658,7 +665,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) at91_stop_clock(); } - return 0; + return ret; } static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)