[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221109005631.3189-2-ansuelsmth@gmail.com>
Date: Wed, 9 Nov 2022 01:56:28 +0100
From: Christian Marangi <ansuelsmth@...il.com>
To: Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...ainline.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, linux-arm-msm@...r.kernel.org,
linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Christian Marangi <ansuelsmth@...il.com>
Subject: [PATCH 2/5] clk: qcom: krait-cc: also enable secondary mux and div clk
clk-krait ignore any rate change if clk is not flagged as enabled.
Correctly enable the secondary mux and div clk to correctly change rate
instead of silently ignoring the request.
Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
---
drivers/clk/qcom/krait-cc.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c
index c2a261cfeb6a..0e497e69e3e3 100644
--- a/drivers/clk/qcom/krait-cc.c
+++ b/drivers/clk/qcom/krait-cc.c
@@ -80,6 +80,7 @@ krait_add_div(struct device *dev, int id, const char *s, unsigned int offset)
};
const char *p_names[1];
struct clk *clk;
+ int cpu;
div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL);
if (!div)
@@ -103,6 +104,17 @@ krait_add_div(struct device *dev, int id, const char *s, unsigned int offset)
}
clk = devm_clk_register(dev, &div->hw);
+ if (IS_ERR(clk))
+ goto err;
+
+ /* clk-krait ignore any rate change if mux is not flagged as enabled */
+ if (id < 0)
+ for_each_online_cpu(cpu)
+ clk_prepare_enable(div->hw.clk);
+ else
+ clk_prepare_enable(div->hw.clk);
+
+err:
kfree(p_names[0]);
kfree(init.name);
@@ -113,7 +125,7 @@ static int
krait_add_sec_mux(struct device *dev, int id, const char *s,
unsigned int offset, bool unique_aux)
{
- int ret;
+ int cpu, ret;
struct krait_mux_clk *mux;
static const char *sec_mux_list[] = {
"qsb",
@@ -165,6 +177,13 @@ krait_add_sec_mux(struct device *dev, int id, const char *s,
if (ret)
goto unique_aux;
+ /* clk-krait ignore any rate change if mux is not flagged as enabled */
+ if (id < 0)
+ for_each_online_cpu(cpu)
+ clk_prepare_enable(mux->hw.clk);
+ else
+ clk_prepare_enable(mux->hw.clk);
+
unique_aux:
if (unique_aux)
kfree(sec_mux_list[0]);
--
2.37.2
Powered by blists - more mailing lists