diff mbox series

clk: correct clk_set_rate for clocks with CLK_GET_RATE_NOCACHE

Message ID 20250414123540.1774593-1-ciprianmarian.costea@oss.nxp.com (mailing list archive)
State Under Review
Headers show
Series clk: correct clk_set_rate for clocks with CLK_GET_RATE_NOCACHE | expand

Commit Message

Ciprian Costea April 14, 2025, 12:35 p.m. UTC
From: Ciprian Marian Costea <ciprianmarian.costea@oss.nxp.com>

According to CLK_GET_RATE_NOCACHE documentation, when this flag is
present, the framework shouldn't use the cached rate of a clock. However,
this doesn't happen during clk_core_set_rate_nolock, part of the
clk_set_rate flow. clk_core_get_rate_nolock was called instead of
clk_core_get_rate_recalc, which should be used to consider the presence of
the CLK_GET_RATE_NOCACHE flag when setting the clock rate.

Co-developed-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@oss.nxp.com>
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 0565c87656cf..d85a6aac0f3c 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 */