From patchwork Wed Oct 2 10:15:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Majunath Goudar X-Patchwork-Id: 2974171 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 680A8BFF0B for ; Wed, 2 Oct 2013 10:36:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9BC920206 for ; Wed, 2 Oct 2013 10:36:13 +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 48F1820274 for ; Wed, 2 Oct 2013 10:36:12 +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 1VRJVn-0001Ej-Fx; Wed, 02 Oct 2013 10:18:32 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRJV0-0003LD-Oa; Wed, 02 Oct 2013 10:17:42 +0000 Received: from mail-pb0-x22e.google.com ([2607:f8b0:400e:c01::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRJUP-0003D5-IW for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2013 10:17:06 +0000 Received: by mail-pb0-f46.google.com with SMTP id rq2so676427pbb.5 for ; Wed, 02 Oct 2013 03:16:44 -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=K5GZ0Ru7NExCZ0IIlIhytiEwkviT8s7yJR9gXeuZYRs=; b=SFRdsi/vuanLfZUAg0JoB4AKc6qMT+DH13LeCvWgNfc1q+6LmGRdqfVJw9ZiMEaBoh P3EGe1ZArkosuEvvOoRScjqnSswYnA8qzlPn6CJheG1XyBXb8Nxa6A+j79Vg711djHdm zfZBRI/pnlB5MCwNn0lpwiqyTphMUE3PGOnP8YQCYYy82crOQSVugmpPiDC7yQH0D45i PTwKw49vx2wlL3S4H9stDjwPH/V9frZgoThiEMlcEelFMtDkBlDiA2Y69g6al6dbHRSf FgrDcXirC5MIbF7Y0LsR+pqL3r6zJrXSiByxShEONfCpIjYLYAkOmNDkEMQjdOyJsop4 c4yA== X-Received: by 10.66.161.229 with SMTP id xv5mr2254947pab.87.1380709004156; Wed, 02 Oct 2013 03:16:44 -0700 (PDT) Received: from localhost.localdomain ([27.61.190.42]) by mx.google.com with ESMTPSA id qw8sm1149855pbb.27.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Oct 2013 03:16:43 -0700 (PDT) From: Majunath Goudar To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/11] USB: OHCI: Properly handle ohci-platform suspend Date: Wed, 2 Oct 2013 15:45:44 +0530 Message-Id: <1380708947-15966-9-git-send-email-csmanjuvijay@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1380708947-15966-1-git-send-email-csmanjuvijay@gmail.com> References: <1380708947-15966-1-git-send-email-csmanjuvijay@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131002_061705_858534_7C4BA22E X-CRM114-Status: GOOD ( 13.73 ) X-Spam-Score: -2.0 (--) Cc: Arnd Bergmann , Greg KH , Manjunath Goudar , linux-usb@vger.kernel.org, Manjunath Goudar , 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=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Manjunath Goudar Suspend scenario in case of ohci-platform glue was not properly handled as it was not suspending generic part of ohci controller.Alan Stern suggested, properly handle ohci-platform suspend scenario. Calling explicitly the ohci_suspend() routine in ohci_platform_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar 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-platform.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index a4c6410..f351ff5 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -139,14 +139,21 @@ static int ohci_platform_remove(struct platform_device *dev) static int ohci_platform_suspend(struct device *dev) { - struct usb_ohci_pdata *pdata = dev_get_platdata(dev); + struct usb_hcd *hcd = dev_get_drvdata(dev); + struct usb_ohci_pdata *pdata = dev->platform_data; struct platform_device *pdev = container_of(dev, struct platform_device, dev); + bool do_wakeup = device_may_wakeup(dev); + int ret; + + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; if (pdata->power_suspend) pdata->power_suspend(pdev); - return 0; + return ret; } static int ohci_platform_resume(struct device *dev)