drivers/clk/qcom/clk-branch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
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>
---
This patch update the logic to correctly handle the invert logic for votable
clocks using the BRANCH_HALT_ENABLE_VOTED flags.
---
drivers/clk/qcom/clk-branch.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/qcom/clk-branch.c b/drivers/clk/qcom/clk-branch.c
index 229480c5b075..0f10090d4ae6 100644
--- a/drivers/clk/qcom/clk-branch.c
+++ b/drivers/clk/qcom/clk-branch.c
@@ -28,7 +28,7 @@ static bool clk_branch_in_hwcg_mode(const struct clk_branch *br)
static bool clk_branch_check_halt(const struct clk_branch *br, bool enabling)
{
- bool invert = (br->halt_check == BRANCH_HALT_ENABLE);
+ bool invert = (br->halt_check & BRANCH_HALT_ENABLE);
u32 val;
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)
{
u32 val;
u32 mask;
- bool invert = (br->halt_check == BRANCH_HALT_ENABLE);
+ bool invert = (br->halt_check & BRANCH_HALT_ENABLE);
mask = CBCR_NOC_FSM_STATUS;
mask |= CBCR_CLK_OFF;
---
base-commit: 9a87ce288fe30f268b3a598422fe76af9bb2c2d2
change-id: 20250128-push_fix-133e5e3c4529
Best regards,
--
Ajit Pandey <quic_ajipan@quicinc.com>
On Tue, 28 Jan 2025 17:08:35 +0530, Ajit Pandey wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] clk: qcom: clk-branch: Fix invert halt status bit check for votable clocks
commit: 5eac348182d2b5ed1066459abedb7bc6b5466f81
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
On Tue, Jan 28, 2025 at 05:08:35PM +0530, Ajit Pandey wrote:
> 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>
> ---
> This patch update the logic to correctly handle the invert logic for votable
> clocks using the BRANCH_HALT_ENABLE_VOTED flags.
> ---
> drivers/clk/qcom/clk-branch.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
© 2016 - 2026 Red Hat, Inc.