From patchwork Mon Dec 17 09:46:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 153971 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2266312ljp; Mon, 17 Dec 2018 01:47:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/WJNqeiy96AgbNZFwAaNPNmykq7NqdsYxXTVaiLCePalHscDqFdj/PZyNmwwxVdcFmcU7vf X-Received: by 2002:a62:37c3:: with SMTP id e186mr12544773pfa.251.1545040046339; Mon, 17 Dec 2018 01:47:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545040046; cv=none; d=google.com; s=arc-20160816; b=nrclwU80O8w24/5LktVyIws9OHi82vImhEEge0sQv3HemHv4muEV+HlayJ9Co5cotQ sPxCjRBvK3gy0Ph/GRe7d2YT999Jb61/WB1uOzRHmGioqPHnP7K2A+n6xDz16N/OjJfB x5cNi5IYTKR5AzLI4r84vbK8dbSZDxlkt67Wnc/oYOFOLN5OEljYUVZGgETS1j/xSsXP iEVa0RSrz8V14vHW1LNE2khKJPdqE8wZF9CWmYPsoicT3dUfEYsTzBuhUm+6dKhKXxEg LcX1lR3gijpKtzWXc7qxf3Aw65YqTGLjO/Vq4+WPPMXLuiSibKtHoRQRqTFTZnih4Wdv Ol2Q== 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=C1MMTiNNsoJUNN6oTDCRBtaiTd1Zc3DZV4sM9URBr89N6/Pc61G5Lt5SUPKxiuGmmq fcelfZ64V6P56iAHBkzoNtQyEPHgKlPt+liuT0HejTjiGcHukfUQQj8iE6pY8ZmRE/c7 0mEyVore6m8f6VEr4VRBqLXAKAHXxQ5zFxAhU7vX3iX7rf05Ho1K8eGQ9phD5LHjuez7 CCHirSkpZMeJ47Yvr0XJgy9bOYCtF/XncqvFBEIPHA1qv2M4LV1svmhW5fEjZUFR1Uzx QPNf8sE2QScuVR+DBdVoXRDjmX1ZC6lZ43SndE2JStRKYUH8qtqDm9Fyaq5VE2bAgbpy GVpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EVZfwTtj; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 y7si10951571pgc.236.2018.12.17.01.47.26; Mon, 17 Dec 2018 01:47:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=EVZfwTtj; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1732201AbeLQJqx (ORCPT + 6 others); Mon, 17 Dec 2018 04:46:53 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51756 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732184AbeLQJqx (ORCPT ); Mon, 17 Dec 2018 04:46:53 -0500 Received: by mail-wm1-f67.google.com with SMTP id s14so11657444wmh.1 for ; Mon, 17 Dec 2018 01:46:51 -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=EVZfwTtjI2HPaEOPFzP9moBBmXkSxInAAJ7BRRRXudV7/1vL8+cD2S4QekPouJEyZd RBe8E8EGJqcoOEh4t41puF2VEVELP1NptHRYarXHNAFkq2dE+DA9q6nGla51q7MoKXhV o5EDvdvD/akneA9Cnt3ExIuUMLAwIwUl7oktA= 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=t0x01ns0ZH4ToL2+0TEFvGl7yDy6nJKiJ8ew9W5JRIRgmEHPuP+wzCSjEqZkVPTs9l FsfHaqyJavXgBMjUUYPBX3gcBIFocL+HNWXvx9+5PTaS/gKEVpYv8UcRIOnv/p49ctS5 EeFqp7qrREY3LObHiZKN5RQjdwAsvTyyleu8tacoXSmnOHXe+Am+Cpg2fKk9XTHv6zKB JhBjb1Ehv8L0occGiJgVuvdxcA/oYaL9G06ZuM21JRSDBWxYRrL6L2z/DUcqYd3jmJgq Pa/uUmmyJItR69C5LxasuQy20G9Drin24DurF6CDGU1NswDhveVvaGqRM7Ht4GB9k8xA DbSA== X-Gm-Message-State: AA+aEWZJ952PtupVhhxdU69tfhHmuTnLEQLK3vGyfKPU3HZSwuvI+NnK cpBnFI1ylZoDgCeUCT7Be359KA== X-Received: by 2002:a1c:81ca:: with SMTP id c193mr11600933wmd.66.1545040011090; Mon, 17 Dec 2018 01:46:51 -0800 (PST) Received: from localhost.localdomain (58.red-81-47-145.staticip.rima-tde.net. [81.47.145.58]) by smtp.gmail.com with ESMTPSA id h12sm28878113wma.48.2018.12.17.01.46.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Dec 2018 01:46:50 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, 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 Cc: bjorn.andersson@linaro.org, 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: [PATCH 08/13] clk: qcom: hfpll: CLK_IGNORE_UNUSED Date: Mon, 17 Dec 2018 10:46:25 +0100 Message-Id: <1545039990-19984-9-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545039990-19984-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1545039990-19984-1-git-send-email-jorge.ramirez-ortiz@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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);