Skip to contentSkip to conversation

clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning

PATCH Applied Johan Hovold 2 participants 4 messages Oct 22, 2024 – Oct 23, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning

Boot firmware may have left the display enabled and this should not generate a warning on boot:

disp_cc_pll0 PLL is already enabled

Also fix up the lucid 5lpe pll enable() implementation which did not return early as intended in case the PLL is already enabled.

Johan

Johan Hovold (2):
clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning
clk: qcom: clk-alpha-pll: fix lucid 5lpe pll enabled check

 drivers/clk/qcom/clk-alpha-pll.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/2 clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning

The boot firmware may have left the display enabled and its PLL running, which currently generates a warning on boot (e.g. on x1e80100):

disp_cc_pll0 PLL is already enabled

Drop the bogus warning and fix up the PLL enabled error handling (trion_pll_is_enabled() only returns 0 or 1).

Fixes d1b121d62b7e ("clk: qcom: Add LUCID_EVO PLL type for SDX65")
---
 drivers/clk/qcom/clk-alpha-pll.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/clk/qcom/clk-alpha-pll.c +1 -6
index f9105443d7db..99d6962d25bb 100644
@@ -2318,13 +2318,8 @@ static int alpha_pll_lucid_evo_enable(struct clk_hw *hw)
 	}
 
 	/* Check if PLL is already enabled */
-	ret = trion_pll_is_enabled(pll, regmap);
-	if (ret < 0) {
-		return ret;
-	} else if (ret) {
-		pr_warn("%s PLL is already enabled\n", clk_hw_get_name(&pll->clkr.hw));
+	if (trion_pll_is_enabled(pll, regmap))
 		return 0;
-	}
 
 	ret = regmap_update_bits(regmap, PLL_MODE(pll), PLL_RESET_N, PLL_RESET_N);
 	if (ret)
Signature · 1 line
2.45.2
#2 lore raw

PATCH 2/2 clk: qcom: clk-alpha-pll: fix lucid 5lpe pll enabled check

In reply to Johan Hovold

The lucid 5lpe PLL enable check only checks for an impossible negative return value and does not actually return as intended in case the PLL is already enabled (e.g. has been left enabled by boot firmware).

Fixes f4c7e27aa4b6 ("clk: qcom: clk-alpha-pll: Add support for Lucid 5LPE PLL")
---
 drivers/clk/qcom/clk-alpha-pll.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/clk/qcom/clk-alpha-pll.c +2 -3
index 99d6962d25bb..bd1dbef04d9d 100644
@@ -1903,9 +1903,8 @@ static int alpha_pll_lucid_5lpe_enable(struct clk_hw *hw)
 	}
 
 	/* Check if PLL is already enabled, return if enabled */
-	ret = trion_pll_is_enabled(pll, pll->clkr.regmap);
-	if (ret < 0)
-		return ret;
+	if (trion_pll_is_enabled(pll, pll->clkr.regmap))
+		return 0;
 
 	ret = regmap_update_bits(pll->clkr.regmap, PLL_MODE(pll), PLL_RESET_N, PLL_RESET_N);
 	if (ret)
Signature · 1 line
2.45.2
maintainer Applied
#3 lore raw
In reply to Johan Hovold
Quoted 9 lines · Johan Hovold

Boot firmware may have left the display enabled and this should not generate a warning on boot:

disp_cc_pll0 PLL is already enabled

Also fix up the lucid 5lpe pll enable() implementation which did not return early as intended in case the PLL is already enabled.

[...]

Applied, thanks!

[1/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning

      commit: f9b493de63eccf0fb6dc1549863590b9749f6f26
[2/2] clk: qcom: clk-alpha-pll: fix lucid 5lpe pll enabled check
      commit: 05b2363b1359195f3c86c98abc133907f8769a69

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>