From patchwork Mon Jan 28 18:32:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 156864 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3748643jaa; Mon, 28 Jan 2019 10:33:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN4UoHOSkYdsWD9Ga3r5IFWJr0lL7UkoqtMRkZSTL5HxIIaCvOLGRN81aJ15G7oMQiXDXsrc X-Received: by 2002:a62:fb07:: with SMTP id x7mr22805753pfm.71.1548700414729; Mon, 28 Jan 2019 10:33:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548700414; cv=none; d=google.com; s=arc-20160816; b=Ks5uWOtKGo6ZRBEct9PBdRiUKeLTDwXbwLq4hc9M9Um94LgGMi5IMt8f9jr53ZqauP OU9uIR0lU4885XcXf6CT6ZcQvRef0XX8SXRe9umutWX6YjOdS4qjxyJqMssgFONQlq1Z TZSMVlvbMfZ4KcuRAD+2FfyWZUMcTkBhN58wo96T01ZQXzNuOFEIg7/teP8Wc9AI7lDf GeOvOzfoRGQwT0XdoL1PJg1TPDeINh/7DJ11XWYaUVEh+m6MApKEkEebiJSwGnIrBzdK VGVtq6PcBfroXr3tZljhJddxll42R5mUf6WNXzKpW2j8oOY6/pXcivgqxeo1/rpjXyPs Pz1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=+HV8Nby8D/Sn6SAvkoxC802zTo0ynRqZ7bbip7gTvlU=; b=Ae27APhdFVdyLuufqKen5q7jf3f7icUDjE/cIZCSX/b6Felpu8Ex0UzvuezOX1YbtD ZMxVKSrUTbc/TL6PPbGOCK6IlkfglTUoZgqLCuHfOoiU4cf7xgJdYCzUT1XvBkJInQcS kWfW4Ly/W/FAdcqpAc9W0OYqwtuBWxb4h/gd3vSoD/0JVyOpv82jmtQDQylVfdZx0i9I Jq0lvJPqG9aH1lE13HPnR2xbI2DhjSpmTrE47CcaFxsmBDoA3sGjz3wkI+xooHEYDMO4 DeAcjVD4jaKYJ3l/SZAJGZpRt2EJIsnPT/4HbZjmT1BGbBViXzOvQc7vFbQeaeDxvFgQ A0QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jSm1rIGl; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 m1si6035595pgi.218.2019.01.28.10.33.34; Mon, 28 Jan 2019 10:33:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=jSm1rIGl; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727988AbfA1Sdc (ORCPT + 15 others); Mon, 28 Jan 2019 13:33:32 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46581 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727967AbfA1Sdc (ORCPT ); Mon, 28 Jan 2019 13:33:32 -0500 Received: by mail-wr1-f66.google.com with SMTP id l9so19165054wrt.13 for ; Mon, 28 Jan 2019 10:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+HV8Nby8D/Sn6SAvkoxC802zTo0ynRqZ7bbip7gTvlU=; b=jSm1rIGlQyTPja2+ldYbXDr+A1YqBNWmTeaDsPGMl7TadS2uye65vk+lYjGr8Yox3F 80uPZnH1mldfRsnbu+xQwdKYVWUR16/oHBEGlzc1Ck4LcODmicjYbz0BPrPxx7pAYW7i UdjwgF9oGxKzZb573jtPHKtsEE2WYnR1uGpxs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+HV8Nby8D/Sn6SAvkoxC802zTo0ynRqZ7bbip7gTvlU=; b=syjNgBfrNSWq6eV9Z7eIl9bYi/cIJNSOoj7bvIO7nXrUQWyEy14J7AU5oOr1sP8JxV qRKzWM0FRVFDekcVAbi9+jvkiYUpnMfVqzZsrs++MbDAiUAvbfr+1FxeUCZMrJuYGMd0 w/6oyatXto/iRrRBlnCJq4nVQA3inMQ4iC0won3nhCPXWInrqUz58UKOt4IA46GYFAbw E3wTH3FSF7ZWt0seJCGMuwjvOii9KZkJCxiHVjpw8tKjQnENwKEIvELePynOKg1KSeH2 5Aelx7hNuTdX4AX7TQTeW5sGDzM4F8HC/uPyhQxko0xwrsRVNgD9c79kN46Q2DmRLyML 7Myg== X-Gm-Message-State: AJcUukek5GUYF0QMas2F/wdyCbhwZ8l5FgJ0cuViPM1lwgvwl+Ygq6eF /KjnxIkvp/9cz41LgJLEqEy/fw== X-Received: by 2002:a5d:6808:: with SMTP id w8mr22035898wru.270.1548700410592; Mon, 28 Jan 2019 10:33:30 -0800 (PST) Received: from localhost.localdomain (233.red-81-47-145.staticip.rima-tde.net. [81.47.145.233]) by smtp.gmail.com with ESMTPSA id l19sm270082wme.21.2019.01.28.10.33.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 10:33:29 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, sboyd@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, david.brown@linaro.org, jassisinghbrar@gmail.com, mark.rutland@arm.com, mturquette@baylibre.com, robh+dt@kernel.org, will.deacon@arm.com, arnd@arndb.de, horms+renesas@verge.net.au, heiko@sntech.de, sibis@codeaurora.org, enric.balletbo@collabora.com, jagan@amarulasolutions.com, olof@lixom.net Cc: vkoul@kernel.org, niklas.cassel@linaro.org, georgi.djakov@linaro.org, amit.kucheria@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-msm@vger.kernel.org, khasim.mohammed@linaro.org Subject: [PATCH v2 08/14] clk: qcom: hfpll: CLK_IGNORE_UNUSED Date: Mon, 28 Jan 2019 19:32:55 +0100 Message-Id: <1548700381-22376-9-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548700381-22376-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1548700381-22376-1-git-send-email-jorge.ramirez-ortiz@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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. 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(+) -- 2.7.4 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);