lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250414123540.1774593-1-ciprianmarian.costea@oss.nxp.com>
Date: Mon, 14 Apr 2025 15:35:40 +0300
From: Ciprian Costea <ciprianmarian.costea@....nxp.com>
To: Michael Turquette <mturquette@...libre.com>,
	Stephen Boyd <sboyd@...nel.org>
Cc: linux-clk@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	NXP S32 Linux Team <s32@....com>,
	imx@...ts.linux.dev,
	Christophe Lizzi <clizzi@...hat.com>,
	Alberto Ruiz <aruizrui@...hat.com>,
	Enric Balletbo <eballetb@...hat.com>,
	Eric Chanudet <echanude@...hat.com>,
	Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>,
	Ghennadi Procopciuc <ghennadi.procopciuc@....com>
Subject: [PATCH] clk: correct clk_set_rate for clocks with CLK_GET_RATE_NOCACHE

From: Ciprian Marian Costea <ciprianmarian.costea@....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@....com>
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@....com>
Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ