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: clk-branch: Fix invert halt status bit check for votable clocks

BRANCH_HALT_ENABLE and BRANCH_HALT_ENABLE_VOTED flags are used to check
halt status of branch clocks, which have an inverted logic for the halt
bit in CBCR register. However, the current logic in the _check_halt()
method only compares the BRANCH_HALT_ENABLE flags, ignoring the votable
branch clocks.

Update the logic to correctly handle the invert logic for votable clocks
using the BRANCH_HALT_ENABLE_VOTED flags.

Fixes: 9092d1083a62 ("clk: qcom: branch: Extend the invert logic for branch2 clocks")
Cc: stable@vger.kernel.org
Signed-off-by: Ajit Pandey <quic_ajipan@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250128-push_fix-v1-1-fafec6747881@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Ajit Pandey and committed by
Bjorn Andersson
5eac3481 497457f6

+2 -2
+2 -2
drivers/clk/qcom/clk-branch.c
··· 28 28 29 29 static bool clk_branch_check_halt(const struct clk_branch *br, bool enabling) 30 30 { 31 - bool invert = (br->halt_check == BRANCH_HALT_ENABLE); 31 + bool invert = (br->halt_check & BRANCH_HALT_ENABLE); 32 32 u32 val; 33 33 34 34 regmap_read(br->clkr.regmap, br->halt_reg, &val); ··· 44 44 { 45 45 u32 val; 46 46 u32 mask; 47 - bool invert = (br->halt_check == BRANCH_HALT_ENABLE); 47 + bool invert = (br->halt_check & BRANCH_HALT_ENABLE); 48 48 49 49 mask = CBCR_NOC_FSM_STATUS; 50 50 mask |= CBCR_CLK_OFF;