Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: qcom: gcc-ipq9574: Add BRANCH_HALT_VOTED flag

The crypto_ahb and crypto_axi clks are hardware voteable.
This means that the halt bit isn't reliable because some
other voter in the system, e.g. TrustZone, could be keeping
the clk enabled when the kernel turns it off from clk_disable().
Make these clks use voting mode by changing the halt check to
BRANCH_HALT_VOTED and toggle the voting bit in the voting register
instead of directly controlling the branch by writing to the branch
register. This fixes stuck clk warnings seen on ipq9574 and saves
power by actually turning the clk off.

Also changes the CRYPTO_AHB_CLK_ENA & CRYPTO_AXI_CLK_ENA
offset to 0xb004 from 0x16014.

Cc: stable@vger.kernel.org
Fixes: f6b2bd9cb29a ("clk: qcom: gcc-ipq9574: Enable crypto clocks")
Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
Link: https://lore.kernel.org/r/20240509105405.1262369-1-quic_mdalam@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Md Sadre Alam and committed by
Bjorn Andersson
72ceafb5 2ba84256

+6 -4
+6 -4
drivers/clk/qcom/gcc-ipq9574.c
··· 2140 2140 2141 2141 static struct clk_branch gcc_crypto_axi_clk = { 2142 2142 .halt_reg = 0x16010, 2143 + .halt_check = BRANCH_HALT_VOTED, 2143 2144 .clkr = { 2144 - .enable_reg = 0x16010, 2145 - .enable_mask = BIT(0), 2145 + .enable_reg = 0xb004, 2146 + .enable_mask = BIT(15), 2146 2147 .hw.init = &(const struct clk_init_data) { 2147 2148 .name = "gcc_crypto_axi_clk", 2148 2149 .parent_hws = (const struct clk_hw *[]) { ··· 2157 2156 2158 2157 static struct clk_branch gcc_crypto_ahb_clk = { 2159 2158 .halt_reg = 0x16014, 2159 + .halt_check = BRANCH_HALT_VOTED, 2160 2160 .clkr = { 2161 - .enable_reg = 0x16014, 2162 - .enable_mask = BIT(0), 2161 + .enable_reg = 0xb004, 2162 + .enable_mask = BIT(16), 2163 2163 .hw.init = &(const struct clk_init_data) { 2164 2164 .name = "gcc_crypto_ahb_clk", 2165 2165 .parent_hws = (const struct clk_hw *[]) {