From patchwork Mon Oct 21 14:18:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Majunath Goudar X-Patchwork-Id: 3077841 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 5072B9F372 for ; Mon, 21 Oct 2013 14:20:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21D542015F for ; Mon, 21 Oct 2013 14:20:01 +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 C9CA22014A for ; Mon, 21 Oct 2013 14:19:59 +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 1VYGKq-0000dP-Uz; Mon, 21 Oct 2013 14:19:57 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYGKo-0004WX-HB; Mon, 21 Oct 2013 14:19:54 +0000 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYGKl-0004TN-36 for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2013 14:19:52 +0000 Received: by mail-pa0-f52.google.com with SMTP id kl14so8075137pab.39 for ; Mon, 21 Oct 2013 07:19:29 -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=Le25L25PRRSxmUx1tbcmFXagXBGR4yezD29uzai9a2g=; b=oDTvqxkclYEUwxyLQb3QIE0HCsDQ5WsA3MaJPeSdc2QpnqGGOgFYl3OKRZ327ISUjf 6TMNk6BVCX5VcN03rahb2rCmxM6Arca5xzRtfmjcCJTM6no0WU681ZrYJWM2jTdfF8dJ Y/PKVslJZ/X2VX7nx2Zv0hgcO4juVW1tu6eRSCYo9ijvk4pRp9qy1B/WL7jeZSy/Acy4 wxq15XxBKtLf5prnwha/5XgQ+8eZLjgZ1Z4IUw3MDixZjoavwHFbNLfaq9rBiUhOwmgH u3E1un26JFLAK4IfKsah1k83tP7T+a0lR342gCrHafkNnKm68C5QSqp86kqRKhVZTKDK dk2A== X-Received: by 10.68.224.38 with SMTP id qz6mr2809771pbc.156.1382365167104; Mon, 21 Oct 2013 07:19:27 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id y9sm26135962pas.10.2013.10.21.07.19.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Oct 2013 07:19:26 -0700 (PDT) From: Majunath Goudar To: csmanjuvijay@gmail.com Subject: [PATCH V4 3/6] USB: OHCI: Properly handle ohci-s3c2410 suspend Date: Mon, 21 Oct 2013 19:48:53 +0530 Message-Id: <1382365136-24472-4-git-send-email-csmanjuvijay@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1382365136-24472-1-git-send-email-csmanjuvijay@gmail.com> References: <1380708947-15966-1-git-send-email-csmanjuvijay@gmail.com> <1382365136-24472-1-git-send-email-csmanjuvijay@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131021_101951_257852_C7E8A5C8 X-CRM114-Status: GOOD ( 16.09 ) X-Spam-Score: 0.1 (/) Cc: linux-samsung-soc@vger.kernel.org, Greg KH , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kukjin Kim , Ben Dooks , 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=-2.3 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=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-s3c2410 glue was not properly handled as it was not suspending generic part of ohci controller. Alan Stern suggested, properly handle ohci-s3c2410 suspend scenario. Calling explicitly the ohci_suspend() routine in ohci_hcd_s3c2410_drv_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Acked-by: Alan Stern Cc: Greg KH Cc: Ben Dooks Cc: Kukjin Kim Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-usb@vger.kernel.org --- V3->V4: -No changes, only added Alan Acked-by. V2->V3: -No changes. As a build failure on "ep93xx proper suspend patch" and Linaro id bounced. Rewrote this patch on top of latest Greg usb-next branch. This patch not gives any build error. Patch is required for ohci-s3c2410 proper suspending as Alan mentioned. Initially when I wrote this patch I was working in Linaro, now I am not part of Linaro that is why Linaro id is bouncing. Sending this patch from personal mail id. V1->V2: -No changes. Due to the build failure on ep93xx reverted this patch. This patch is needed as Alan Stern suggestion. drivers/usb/host/ohci-s3c2410.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index be3429e..b5bf9b7 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev) static int ohci_hcd_s3c2410_drv_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); - struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct platform_device *pdev = to_platform_device(dev); - unsigned long flags; + bool do_wakeup = device_may_wakeup(dev); int rc = 0; - /* - * Root hub was already suspended. Disable irq emission and - * mark HW unaccessible, bail out if RH has been resumed. Use - * the spinlock to properly synchronize with possible pending - * RH suspend or resume activity. - */ - spin_lock_irqsave(&ohci->lock, flags); - if (ohci->rh_state != OHCI_RH_SUSPENDED) { - rc = -EINVAL; - goto bail; - } - - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + rc = ohci_suspend(hcd, do_wakeup); + if (rc) + return rc; s3c2410_stop_hc(pdev); -bail: - spin_unlock_irqrestore(&ohci->lock, flags); return rc; }