Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964918AbbELXXx (ORCPT ); Tue, 12 May 2015 19:23:53 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57221 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933666AbbELXXu (ORCPT ); Tue, 12 May 2015 19:23:50 -0400 Message-ID: <55528B84.5050700@codeaurora.org> Date: Tue, 12 May 2015 16:23:48 -0700 From: Stephen Boyd User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Sascha Hauer , Mike Turquette CC: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: Re: Automatic clock disabling on clk_put() References: <20150511060129.GG6325@pengutronix.de> In-Reply-To: <20150511060129.GG6325@pengutronix.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1216 Lines: 31 On 05/10/15 23:01, Sascha Hauer wrote: > Hi, > > Since we now have per-user clks we could automatically disable clks on > clk_put() to make the drivers errors paths easier. AFAIR that was one > of the motivations to switch to per user clks. Is this just not yet > implemented or are there problems implementing this? > > I don't recall that as being a motivation for per-user clks. The documentation explicitly states: * Note: drivers must ensure that all clk_enable calls made on this * clock source are balanced by clk_disable calls prior to calling * this function. so it seems that such a behavior would be an API change. Is it really that hard to call clk_disable_unprepare() on a clock at the end of an error path? Maybe you could add a devm_clk_get_prepare_enable() that does what you want and then call clk_disable_unprepare on the exit path? -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/