Skip to content

Commit 5eac348

Browse files
Ajit Pandeyandersson
authored andcommitted
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: 9092d10 ("clk: qcom: branch: Extend the invert logic for branch2 clocks") Cc: [email protected] Signed-off-by: Ajit Pandey <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 497457f commit 5eac348

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/clk/qcom/clk-branch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static bool clk_branch_in_hwcg_mode(const struct clk_branch *br)
2828

2929
static bool clk_branch_check_halt(const struct clk_branch *br, bool enabling)
3030
{
31-
bool invert = (br->halt_check == BRANCH_HALT_ENABLE);
31+
bool invert = (br->halt_check & BRANCH_HALT_ENABLE);
3232
u32 val;
3333

3434
regmap_read(br->clkr.regmap, br->halt_reg, &val);
@@ -44,7 +44,7 @@ static bool clk_branch2_check_halt(const struct clk_branch *br, bool enabling)
4444
{
4545
u32 val;
4646
u32 mask;
47-
bool invert = (br->halt_check == BRANCH_HALT_ENABLE);
47+
bool invert = (br->halt_check & BRANCH_HALT_ENABLE);
4848

4949
mask = CBCR_NOC_FSM_STATUS;
5050
mask |= CBCR_CLK_OFF;

0 commit comments

Comments
 (0)