public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning
@ 2024-10-22  8:05 Johan Hovold
  2024-10-22  8:05 ` [PATCH 1/2] " Johan Hovold
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Johan Hovold @ 2024-10-22  8:05 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Michael Turquette, Stephen Boyd, Vamsi Krishna Lanka,
	Vivek Aknurwar, Vinod Koul, Jeevan Shriram, linux-arm-msm,
	linux-clk, linux-kernel, 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.

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(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning
  2024-10-22  8:05 [PATCH 0/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning Johan Hovold
@ 2024-10-22  8:05 ` Johan Hovold
  2024-10-22  8:05 ` [PATCH 2/2] clk: qcom: clk-alpha-pll: fix lucid 5lpe pll enabled check Johan Hovold
  2024-10-23  4:15 ` [PATCH 0/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning Bjorn Andersson
  2 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2024-10-22  8:05 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Michael Turquette, Stephen Boyd, Vamsi Krishna Lanka,
	Vivek Aknurwar, Vinod Koul, Jeevan Shriram, linux-arm-msm,
	linux-clk, linux-kernel, Johan Hovold

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")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/clk/qcom/clk-alpha-pll.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
index f9105443d7db..99d6962d25bb 100644
--- a/drivers/clk/qcom/clk-alpha-pll.c
+++ b/drivers/clk/qcom/clk-alpha-pll.c
@@ -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)
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] clk: qcom: clk-alpha-pll: fix lucid 5lpe pll enabled check
  2024-10-22  8:05 [PATCH 0/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning Johan Hovold
  2024-10-22  8:05 ` [PATCH 1/2] " Johan Hovold
@ 2024-10-22  8:05 ` Johan Hovold
  2024-10-23  4:15 ` [PATCH 0/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning Bjorn Andersson
  2 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2024-10-22  8:05 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Michael Turquette, Stephen Boyd, Vamsi Krishna Lanka,
	Vivek Aknurwar, Vinod Koul, Jeevan Shriram, linux-arm-msm,
	linux-clk, linux-kernel, 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")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/clk/qcom/clk-alpha-pll.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
index 99d6962d25bb..bd1dbef04d9d 100644
--- a/drivers/clk/qcom/clk-alpha-pll.c
+++ b/drivers/clk/qcom/clk-alpha-pll.c
@@ -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)
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning
  2024-10-22  8:05 [PATCH 0/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning Johan Hovold
  2024-10-22  8:05 ` [PATCH 1/2] " Johan Hovold
  2024-10-22  8:05 ` [PATCH 2/2] clk: qcom: clk-alpha-pll: fix lucid 5lpe pll enabled check Johan Hovold
@ 2024-10-23  4:15 ` Bjorn Andersson
  2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Andersson @ 2024-10-23  4:15 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Michael Turquette, Stephen Boyd, Vamsi Krishna Lanka,
	Vivek Aknurwar, Vinod Koul, Jeevan Shriram, linux-arm-msm,
	linux-clk, linux-kernel


On Tue, 22 Oct 2024 10:05:19 +0200, Johan Hovold wrote:
> 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,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-23  4:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-22  8:05 [PATCH 0/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning Johan Hovold
2024-10-22  8:05 ` [PATCH 1/2] " Johan Hovold
2024-10-22  8:05 ` [PATCH 2/2] clk: qcom: clk-alpha-pll: fix lucid 5lpe pll enabled check Johan Hovold
2024-10-23  4:15 ` [PATCH 0/2] clk: qcom: clk-alpha-pll: drop lucid-evo pll enabled warning Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox