From patchwork Fri Dec 13 19:56:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 3342431 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 8058BC0D4A for ; Fri, 13 Dec 2013 19:57:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98B4B20783 for ; Fri, 13 Dec 2013 19:57:23 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A357B20781 for ; Fri, 13 Dec 2013 19:57:22 +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 1VrYrN-0004jx-Ou; Fri, 13 Dec 2013 19:57:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VrYrL-0007cg-8R; Fri, 13 Dec 2013 19:57:15 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VrYrI-0007cL-6z for linux-arm-kernel@lists.infradead.org; Fri, 13 Dec 2013 19:57:12 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id rBDJuoqK032558; Fri, 13 Dec 2013 13:56:50 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rBDJuo3h019637; Fri, 13 Dec 2013 13:56:50 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Fri, 13 Dec 2013 13:56:50 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rBDJunLp005664; Fri, 13 Dec 2013 13:56:49 -0600 Date: Fri, 13 Dec 2013 13:56:18 -0600 From: Felipe Balbi To: Anton Tikhomirov Subject: Re: [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support Message-ID: <20131213195618.GG5292@saruman.home> References: <1386884325-11440-1-git-send-email-balbi@ti.com> <1386884325-11440-8-git-send-email-balbi@ti.com> <000301cef7c0$640c1ce0$2c2456a0$%tikhomirov@samsung.com> MIME-Version: 1.0 In-Reply-To: <000301cef7c0$640c1ce0$2c2456a0$%tikhomirov@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131213_145712_340405_0A92E03E X-CRM114-Status: GOOD ( 16.20 ) X-Spam-Score: -6.9 (------) Cc: kgene.kim@samsung.com, w-kwok2@ti.com, 'Linux USB Mailing List' , 'Felipe Balbi' , linux-samsung-soc@vger.kernel.org, 'Santosh Shilimkar' , 'Linux OMAP Mailing List' , 'Linux ARM Kernel Mailing List' X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: balbi@ti.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.2 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 On Fri, Dec 13, 2013 at 02:01:32PM +0900, Anton Tikhomirov wrote: > Hi Felipe, > > > -static int dwc3_exynos_suspend(struct device *dev) > > +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos) > > { > > - struct dwc3_exynos *exynos = dev_get_drvdata(dev); > > - > > clk_disable(exynos->clk); > > > > return 0; > > } > > > > +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos) > > +{ > > + return clk_enable(exynos->clk); > > +} > > + > > +static int dwc3_exynos_suspend(struct device *dev) > > +{ > > + struct dwc3_exynos *exynos = dev_get_drvdata(dev); > > + > > + return __dwc3_exynos_suspend(exynos); > > If dwc3-exynos is runtime suspended, the clock will be disabled > second time here (unbalanced clk_enable/clk_disable). I don't get what you mean but there is something that probably needs fixing, I guess below makes it better: Is that what you meant ? diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index c93919a..1e5720a 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -218,6 +218,9 @@ static int dwc3_exynos_suspend(struct device *dev) { struct dwc3_exynos *exynos = dev_get_drvdata(dev); + if (pm_runtime_suspended(dev)) + return 0; + return __dwc3_exynos_suspend(exynos); }