Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1814692imu; Thu, 17 Jan 2019 03:47:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN4nAI9/zl9kVn0YailweZnKN56ShR8g05fMucuXwbkrsGjrV+QpMFtt+u2dFZfL8FKJZ5YH X-Received: by 2002:a63:4b60:: with SMTP id k32mr13088116pgl.186.1547725641027; Thu, 17 Jan 2019 03:47:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547725640; cv=none; d=google.com; s=arc-20160816; b=YnevlowP9Y8y4cuQnSavxf4TKtX719xMtONPwPhJoE9aQJttJRlZg/ptBsRbaOdaJ5 RdXDrhcthdxELwHWMCwdAEflNhEp2G9N2EpPfX82K8QTzGWJmQLHRGj1h5VobbOM+45N Vo1njc02ePMQsKvt0p5Q+jpy4OneXsNs3WY3gxsPqV1JlxIpVqXRzqmAaJj4MhgyyIHx SybqSimJWvqKvZchqB0c5oczruHw3K1mlmERwm2p0m/cgg+ucKjxi5QSHzlY4cFy96CL wQO8czDecsdlhQXsZv/dlxlQlB8w9xjC3xyLaDpZ8H6vEuZQmTxiki/QrAAaL4XHsEvD wY0Q== 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=+HjIxHy2YTkkHug9kwKKVx+R4/lzJQ2zziaHnfwNtT0=; b=cGl2lJ3q95OdDnFcChKcMUPSN55nwOhH3496omXvyxEWWRu14B/Usg/bxVh8sfg8Ns HwtTWriJQLmY6noJMc6U2t6RAHvoK1Rxuj1BSBeDhkEqxVNaOEKEm/AB3ihpzSzaVgqw 1J/dofN/I49TibylqdcS++c2VsURPek4wS+tTErUUUEktulKiuLdZPwvJY6oXQAQ5Q2T 96X1sUsYXhS6qx9JEW/0bEUq32DbIQVGhhKclQV+zqCsq7kW/eUAfuugCHHo6RHSrTPT BzAo5/Nf64Lx7+H8WZzUHzFkJ48aqY8x++i9qJuBJOkAAimt0MWRrdAX3QyqDLg7gqg7 XKig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gXTQ10Xn; 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 m20si1352818pgk.323.2019.01.17.03.47.05; Thu, 17 Jan 2019 03:47:20 -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=gXTQ10Xn; 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 S1727934AbfAQKIM (ORCPT + 99 others); Thu, 17 Jan 2019 05:08:12 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43962 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727151AbfAQKIM (ORCPT ); Thu, 17 Jan 2019 05:08:12 -0500 Received: by mail-pf1-f193.google.com with SMTP id w73so4594257pfk.10 for ; Thu, 17 Jan 2019 02:08:11 -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=+HjIxHy2YTkkHug9kwKKVx+R4/lzJQ2zziaHnfwNtT0=; b=gXTQ10XnlhXUwSxfQybKblMRmC9bRikmPdTT7rRHBFXGAyRW9/ly/WqIiLeziMB9UH N+JNiE0z4eITRZIaIFp+hRVpGVi4mrgjQBRwgPGLxrOqU4iDNE0762Ba/nI1nGgwd2RG OZFVQTJzmUO1x4Z8F8AIsErji3dEtamnF2Jnw= 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=+HjIxHy2YTkkHug9kwKKVx+R4/lzJQ2zziaHnfwNtT0=; b=HSFWlXupTwF1T77QfpnqVW7let9NoTOE34rrXoguzSRHOUOjCb7kaA8KYj0ieOiFp+ KeRZDUKN2gA/aoICMkS4I83ShrByF8cTrRHbU+XM5h3PzdBZD66ot7WiJtqBXxkTrbGq tkRnGFKIr1ew/E9xMkP29RRlYdQbO67cKQEHyunXWL2zGwHsk6lN0/nFI8Y123FImmIk Tpb4r0oAmB35JBxryvZhQG9GcCm8uowDdxt2O2/GEDQ3OObw+PXzwOFtju6zxzsQLb5L 9Fwu3DXUZY22rGid/OYgbOBd5Rtyjljy7XrH7GIHrtKFxdlbPGqdx6HIB4FCKZe/f946 d2Fw== X-Gm-Message-State: AJcUukekPqlR3zPvEp3T7kLuj5rgf2xmv9vWAFYxVTPcXTeic9vPINSe d/xcOIhaKpHGLr2O6tKCXfeKbQ== X-Received: by 2002:a62:76cc:: with SMTP id r195mr14268347pfc.38.1547719690261; Thu, 17 Jan 2019 02:08:10 -0800 (PST) Received: from localhost ([122.172.102.63]) by smtp.gmail.com with ESMTPSA id y89sm3127863pfa.136.2019.01.17.02.08.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 02:08:09 -0800 (PST) Date: Thu, 17 Jan 2019 15:38:07 +0530 From: Viresh Kumar To: Jorge Ramirez Cc: Bjorn Andersson , 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: <20190117100807.pmew5iqisdcc63eq@vireshk-i7> References: <1545039990-19984-1-git-send-email-jorge.ramirez-ortiz@linaro.org> <1545039990-19984-9-git-send-email-jorge.ramirez-ortiz@linaro.org> <20190117063312.GE25498@builder> <9abbe59b-433c-4e30-1e4d-b5eed3afc695@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9abbe59b-433c-4e30-1e4d-b5eed3afc695@linaro.org> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17-01-19, 09:38, Jorge Ramirez wrote: > COMMON_CLK_DISABLED_UNUSED relies on the enable_count reference counter > to disable the clocks that were enabled by the firwmare and not by the > drivers. > > the cpufreq driver does not enable the cpu clock. > > so when clk_change_rate is called, the enable_count counter is not > incremented and therefore it just remains null since this was enabled by > the firmware. > > I tried doing: > > diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c > index e58bfcb..5a9f83e 100644 > --- a/drivers/cpufreq/cpufreq-dt.c > +++ b/drivers/cpufreq/cpufreq-dt.c > @@ -124,6 +124,10 @@ static int resources_available(void) > return ret; > } > > + ret = clk_prepare_enable(cpu_clk); > + if (ret) > + return ret; > + > clk_put(cpu_clk); > > name = find_supply_name(cpu_dev); > > > and that removed the need for CLK_IGNORE_UNUSED. But I am not sure of > the system wide consequences of that change to cpufreq. If the cpufreq driver enables it then it should disable it on exit as well, right ? And in that case if you unload your driver's module, you will hang the system as the clock will get disabled :) Every other platform must either be marking it with CLK_IGNORE_UNUSED or they must be doing clk_enable from somewhere, maybe the CPU online path, not sure though. -- viresh