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: 3342421 Return-Path: X-Original-To: patchwork-linux-omap@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 0809A9F2A9 for ; Fri, 13 Dec 2013 19:57:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72FA620783 for ; Fri, 13 Dec 2013 19:57:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0EE820781 for ; Fri, 13 Dec 2013 19:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752991Ab3LMT5R (ORCPT ); Fri, 13 Dec 2013 14:57:17 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:41382 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752538Ab3LMT5P (ORCPT ); Fri, 13 Dec 2013 14:57:15 -0500 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 CC: "'Felipe Balbi'" , "'Linux USB Mailing List'" , , "'Linux ARM Kernel Mailing List'" , , "'Linux OMAP Mailing List'" , , "'Santosh Shilimkar'" Subject: Re: [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support Message-ID: <20131213195618.GG5292@saruman.home> Reply-To: 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 Content-Disposition: inline In-Reply-To: <000301cef7c0$640c1ce0$2c2456a0$%tikhomirov@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, 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); }