Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1677791imu; Thu, 17 Jan 2019 01:14:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN7fQcoivEYSeLcCeFSlgZMcbA9X7AGehS3UeG35XkVUn/PSXS86YZettUg49bgjXB+lJq3z X-Received: by 2002:a63:6150:: with SMTP id v77mr12483480pgb.266.1547716492644; Thu, 17 Jan 2019 01:14:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547716492; cv=none; d=google.com; s=arc-20160816; b=gUzK/5Rhr0Duj6w/4/SeDDHWGR5MOhu46XKDVsbDrPSCtyXtoblsw8cMnDRMm6GQ4W 4mLs8KqiLTQLzuEQfJx5koxgD4eBE+cxHFd85PeOc9N7Lfn5cVBVZkdxdflzT9GCGzd0 7/z6JUvl0OofTuNm4Qgy6mVEXdGIWfPzg9c9lE8A4LpN1DjtvVAJuYHqJr4fkiNeisGB 5gabvjk2YkoJVo3NzdNfUiI+JGdSXzsCPCJEPVbGulKdMW0OoUen62rvPSQupp2TuLpG nYg0ptodWfsTJ6ufQzns0yJdreN95PdXXL0aSZuU7IMC11uUqSEncZAoh+ii0UY/fksf XFfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aqC+vB4fSjRN90IibQ7rlURw1TMhvABYquzwyDXgypA=; b=HehyBrTpeXrlPOq9fXMFEnRBMmaxSKAwha0HtYzIn9iZORVSFmxDfF3Yxh/uFN/Rwl uFjpuPoM0FOHCbV32iw1FFSvMJGPn8xYRQOeylw3Ctb+ePsGtfqKWkCzCznFroj158gS gupY9nZO2uSluto0mi1HcYW85zATiWDNC3HyVrop3Kak0T/3SmyX7pd+3yOClvsMJCsO HKtDnPT3+3VuRvS0Gi0cICLyLGEGvKwUVusB4giUyz/TCoCOV5BO8N/5BykSBYBvtWHn pc2w+OvLE9yJ1GqsYtY0B7JlErmwOuTdwWHXAmjZoZ9QoY3D4Dti7EDpEWzqOqrF4Qn6 j7Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NNL/kO9C"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si1141104plg.318.2019.01.17.01.14.37; Thu, 17 Jan 2019 01:14:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NNL/kO9C"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbfAQGdz (ORCPT + 99 others); Thu, 17 Jan 2019 01:33:55 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:35300 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727184AbfAQGdy (ORCPT ); Thu, 17 Jan 2019 01:33:54 -0500 Received: by mail-pg1-f195.google.com with SMTP id s198so3993201pgs.2 for ; Wed, 16 Jan 2019 22:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aqC+vB4fSjRN90IibQ7rlURw1TMhvABYquzwyDXgypA=; b=NNL/kO9CdzEPti7SThDJKLv7Yq+SCVjXCEv003EZOStG3hNTBpZfyr6YP2iPuGFqD/ MOLr/6bfHbUk+HqbJjIer6QZDxP24yIvm4NpTf1EcEBIYGpOX2Mr2QPcU/pAWw0rRUpB B8K5bFtba6YWPktyH7QWTfPTRL38b8zQRjZ2M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=aqC+vB4fSjRN90IibQ7rlURw1TMhvABYquzwyDXgypA=; b=lab7VYtK66igIWmzzuAxySEIP4vCey0NIB4gWC8ChVghpX9dsAholPAeE5ryADzgtm /iyHd/YxA4Dtg2xhX5B5dQFC6GsRONvZ7JlTnUSambhVQEh3u9YH9uu6NsfPea1OcthY jiqz7Id8kSexIVvgmOKk6ktSNHoQvdRNt/aWwz6/0gQpjx8xqtbHLRfuZ0cKasUsSmll gykK+E51Z9ihsTr+GO8ppvjYeCCue1l93rHRH7lypDJqQ8vVZXbL8/s/ehKEVXF5zceN l716yLRnFDXuS1Ke/4FNnzU/AoKJ43B1Aro8xxDBzzZj3Qyg72C+Kfih5DxOogr/lEBo 4+fg== X-Gm-Message-State: AJcUukdTcdk9VFESx0HRv32x6LtamrS8SHw4pMzd2NgnbtiNdXyvauHE tEmKsx+wE+BnDIG0kxlg52jzew== X-Received: by 2002:a62:fb07:: with SMTP id x7mr13619330pfm.71.1547706833568; Wed, 16 Jan 2019 22:33:53 -0800 (PST) Received: from builder (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id b4sm793210pgq.65.2019.01.16.22.33.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Jan 2019 22:33:52 -0800 (PST) Date: Wed, 16 Jan 2019 22:33:12 -0800 From: Bjorn Andersson To: Jorge Ramirez-Ortiz Cc: robh+dt@kernel.org, mark.rutland@arm.com, andy.gross@linaro.org, david.brown@linaro.org, sboyd@kernel.org, will.deacon@arm.com, mturquette@baylibre.com, jassisinghbrar@gmail.com, vkoul@kernel.org, niklas.cassel@linaro.org, sibis@codeaurora.org, georgi.djakov@linaro.org, arnd@arndb.de, horms+renesas@verge.net.au, heiko@sntech.de, enric.balletbo@collabora.com, jagan@amarulasolutions.com, olof@lixom.net, amit.kucheria@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: Re: [PATCH 08/13] clk: qcom: hfpll: CLK_IGNORE_UNUSED Message-ID: <20190117063312.GE25498@builder> References: <1545039990-19984-1-git-send-email-jorge.ramirez-ortiz@linaro.org> <1545039990-19984-9-git-send-email-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1545039990-19984-9-git-send-email-jorge.ramirez-ortiz@linaro.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 17 Dec 01:46 PST 2018, Jorge Ramirez-Ortiz wrote: > When COMMON_CLK_DISABLED_UNUSED is set, in an effort to save power and > to keep the software model of the clock in line with reality, the > framework transverses the clock tree and disables those clocks that > were enabled by the firmware but have not been enabled by any device > driver. > > If CPUFREQ is enabled, early during the system boot, it might attempt > to change the CPU frequency ("set_rate"). If the HFPLL is selected as > a provider, it will then change the rate for this clock. > > As boot continues, clk_disable_unused_subtree will run. Since it wont > find a valid counter (enable_count) for a clock that is actually > enabled it will attempt to disable it which will cause the CPU to > stop. Notice that in this driver, calls to check whether the clock is > enabled are routed via the is_enabled callback which queries the > hardware. > With the CPUFREQ referencing the CPU clock driver, that has decided to run off this clock, why is it not refcounted? Regards, Bjorn > The following commit, rather than marking the clock critical and > forcing the clock to be always enabled, addresses the above scenario > making sure the clock is not disabled but it continues to rely on the > firmware to enable the clock. > > Co-developed-by: Niklas Cassel > Signed-off-by: Niklas Cassel > Signed-off-by: Jorge Ramirez-Ortiz > --- > drivers/clk/qcom/hfpll.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c > index 0ffed0d..9d92f5d 100644 > --- a/drivers/clk/qcom/hfpll.c > +++ b/drivers/clk/qcom/hfpll.c > @@ -58,6 +58,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev) > .parent_names = (const char *[]){ "xo" }, > .num_parents = 1, > .ops = &clk_ops_hfpll, > + .flags = CLK_IGNORE_UNUSED, > }; > > h = devm_kzalloc(dev, sizeof(*h), GFP_KERNEL); > -- > 2.7.4 >