[PATCH 3/3] clk: qcom: rcg2: Clear force enable after rate failure
From: Konrad Dybcio
Date: Thu Sep 17 2026 - 05:20:06 EST
From: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
Shared RCG rate changes assert force-enable before programming the new
configuration. If programming fails, the function returns without
clearing force-enable, leaving the root running while CCF can release
temporary parent and resource references.
Attempt to clear force-enable on the configuration error path before
returning the original programming error. This restores the same cleanup
performed after a successful configuration while preserving the primary
failure for callers.
Fixes: 7ef6f11887bd ("clk: qcom: Configure the RCGs to a safe source as needed")
Assisted-by: LLM
Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
---
drivers/clk/qcom/clk-rcg2.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
index 54d122e2e0d6..c44c51d860e1 100644
--- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c
@@ -1364,8 +1364,10 @@ clk_rcg2_shared_force_enable_clear(struct clk_hw *hw, const struct freq_tbl *f)
return ret;
ret = clk_rcg2_configure(rcg, f);
- if (ret)
+ if (ret) {
+ clk_rcg2_clear_force_enable(hw);
return ret;
+ }
return clk_rcg2_clear_force_enable(hw);
}
--
2.55.0