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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231207093345.581048-2-peng.fan@oss.nxp.com>
Date:   Thu,  7 Dec 2023 17:33:45 +0800
From:   "Peng Fan (OSS)" <peng.fan@....nxp.com>
To:     sudeep.holla@....com, cristian.marussi@....com,
        mturquette@...libre.com, sboyd@...nel.org
Cc:     linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
        linux-kernel@...r.kernel.org, ranjani.vaidyanathan@....com,
        glen.wienecke@....com, nitin.garg_3@....com, chuck.cannon@....com,
        Peng Fan <peng.fan@....com>
Subject: [PATCH V2 2/2] clk: scmi: support state_ctrl_forbidden

From: Peng Fan <peng.fan@....com>

Some clocks may exported to linux, while those clocks are not allowed
to configure by Linux. For example:

SYS_CLK1-----
             \
	     --MUX--->MMC1_CLK
             /
SYS_CLK2-----

MMC1 needs set parent, so SYS_CLK1 and SYS_CLK2 are exported to Linux,
then the clk propagation will touch SYS_CLK1 or SYS_CLK2.
So we need bypass the failure for SYS_CLK1 or SYS_CLK2 when enable
the clock of MMC1.

Signed-off-by: Peng Fan <peng.fan@....com>
---

V2:
 New. Take Cristian's suggestion

 drivers/clk/clk-scmi.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
index 8cbe24789c24..1d809813eabd 100644
--- a/drivers/clk/clk-scmi.c
+++ b/drivers/clk/clk-scmi.c
@@ -119,8 +119,14 @@ static int scmi_clk_determine_rate(struct clk_hw *hw, struct clk_rate_request *r
 static int scmi_clk_enable(struct clk_hw *hw)
 {
 	struct scmi_clk *clk = to_scmi_clk(hw);
+	int ret;
+
+	ret = scmi_proto_clk_ops->enable(clk->ph, clk->id, NOT_ATOMIC);
 
-	return scmi_proto_clk_ops->enable(clk->ph, clk->id, NOT_ATOMIC);
+	if (ret == -EACCES && clk->info->state_ctrl_forbidden)
+		return 0;
+
+	return ret;
 }
 
 static void scmi_clk_disable(struct clk_hw *hw)
-- 
2.37.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ