From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757725AbcIMOGe (ORCPT ); Tue, 13 Sep 2016 10:06:34 -0400 Received: from mga02.intel.com ([134.134.136.20]:1102 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756561AbcIMOGb (ORCPT ); Tue, 13 Sep 2016 10:06:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,328,1470726000"; d="scan'208";a="1029306672" From: Felipe Balbi To: Guenter Roeck Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Question about suspend/resume clock handling in dwc3-of-simple.c In-Reply-To: <2ec1668d-9e27-926f-5cad-f9f1b541ef84@roeck-us.net> References: <20160912185629.GA25929@roeck-us.net> <87wpihaqhv.fsf@linux.intel.com> <20160912194349.GA14284@roeck-us.net> <87bmzsl5uz.fsf@linux.intel.com> <2ec1668d-9e27-926f-5cad-f9f1b541ef84@roeck-us.net> User-Agent: Notmuch/0.22.1+63~g994277e (https://notmuchmail.org) Emacs/25.1.3 (x86_64-pc-linux-gnu) Date: Tue, 13 Sep 2016 17:05:40 +0300 Message-ID: <87d1k7x5cb.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Guenter Roeck writes: > On 09/12/2016 10:35 PM, Felipe Balbi wrote: >> >> Hi, >> >> Guenter Roeck writes: >>>>> Should it be clk_disable_unprepare(), or maybe something like the >>>>> following >>>>> >>>>> if (!pm_runtime_status_suspended(dev)) >>>>> clk_disable_unprepare(); >>>>> else >>>>> clk_unprepare(); >>>> >>>> I'm not sure how balanced those calls are, yeah. I don't have HW to test >>>> PM with. But note that as it is, there is no actual runtime PM support, >>>> so clk_disable_unprepare() will always be necessary. >>>> >>>> Perhaps we will find further issues when someone tries to use runtime PM >>>> with dwc3-of-simple. ;-) >>>> >>> >>> We are working on code derived from it, so unless I can convince the author >>> that he can not just use clk_unprepare() I suspect we'll hit the problem. >>> If so, I'll let you know. >> >> Are you sending that upstream? Depending on your requirements, it might >> be easier to patch dwc3-of-simple.c then adding yet another glue layer :-) >> > Yes. It will be a glue layer. So far that looks like the cleanest solution. fair enough, take your time ;-) -- balbi