diff options
author | Chuan Liu <chuan.liu@amlogic.com> | 2024-09-10 13:53:44 +0800 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2024-11-18 19:51:28 -0800 |
commit | 25f1c96a0e841013647d788d4598e364e5c2ebb7 (patch) | |
tree | f7225391da7df9944fc6b19b66fa5015970e2155 | |
parent | 6e4bf018bb040955da53dae9f8628ef8fcec2dbe (diff) | |
download | lwn-25f1c96a0e841013647d788d4598e364e5c2ebb7.tar.gz lwn-25f1c96a0e841013647d788d4598e364e5c2ebb7.zip |
clk: Fix invalid execution of clk_set_rate
Some clocks have rates that can be changed elsewhere, so add a flag
CLK_GET_RATE_NOCACHE(such as scmi_clk) to these clocks to ensure that
the real-time rate is obtained.
When clk_set_rate is called, it is returned if the request to set rate
is consistent with the current rate. Getting the current rate in
clk_set_rate returns the rate stored in clk_core. CLK_GET_RATE_NOCACHE
does not take effect here.
Signed-off-by: Chuan Liu <chuan.liu@amlogic.com>
Link: https://lore.kernel.org/r/20240910-fix_clk-v1-1-111443baaeaa@amlogic.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
-rw-r--r-- | drivers/clk/clk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 9b45fa005030..bdc6e5b90da5 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2530,7 +2530,7 @@ static int clk_core_set_rate_nolock(struct clk_core *core, rate = clk_core_req_round_rate_nolock(core, req_rate); /* bail early if nothing to do */ - if (rate == clk_core_get_rate_nolock(core)) + if (rate == clk_core_get_rate_recalc(core)) return 0; /* fail on a direct rate set of a protected provider */ |