From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbcBMBS6 (ORCPT ); Fri, 12 Feb 2016 20:18:58 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:37417 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751094AbcBMBS5 (ORCPT ); Fri, 12 Feb 2016 20:18:57 -0500 Date: Fri, 12 Feb 2016 17:18:55 -0800 From: Stephen Boyd To: Michael Turquette Cc: linux-clk@vger.kernel.org, lee.jones@linaro.org, maxime.ripard@free-electrons.com, maxime.coquelin@st.com, geert@linux-m68k.org, heiko@sntech.de, andre.przywara@arm.com, rklein@nvidia.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v42 5/6] clk: clk_put WARNs if user has not disabled clk Message-ID: <20160213011855.GL4847@codeaurora.org> References: <1455225554-13267-1-git-send-email-mturquette@baylibre.com> <1455225554-13267-6-git-send-email-mturquette@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455225554-13267-6-git-send-email-mturquette@baylibre.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/11, Michael Turquette wrote: > >From the clk_put kerneldoc in include/linux/clk.h: > > """ > 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. > """ > > The common clock framework implementation of the clk.h api has per-user > reference counts for calls to clk_prepare and clk_disable. As such it > can enforce the requirement to properly call clk_disable and > clk_unprepare before calling clk_put. > > Because this requirement is probably violated in many places, this patch > starts with a simple warning. Once offending code has been fixed this > check could additionally release the reference counts automatically. Do we have any fixes for pm code in the works? I'm worried we're going to be giving a warning and nobody will fix them or has a plan to fix them. > > Signed-off-by: Michael Turquette > --- Reviewed-by: Stephen Boyd -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project