Skip to contentSkip to conversation

FAILED: patch "[PATCH] clk: qcom: clk-alpha-pll: Don't reconfigure running Trion" failed to apply to 5.10-stable tree

PATCH [email protected] 1 participant 1 message Dec 12, 2021

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From a1f0019c342bd83240b05be68c9888549dde7935 Mon Sep 17 00:00:00 2001
From: Bjorn Andersson <[email protected]>
Date: Tue, 23 Nov 2021 08:25:08 -0800
Subject: [PATCH] clk: qcom: clk-alpha-pll: Don't reconfigure running Trion

In the event that the bootloader has configured the Trion PLL as source for the display clocks, e.g. for the continuous splashscreen, then there will also be RCGs that are clocked by this instance.

Reconfiguring, and in particular disabling the output of, the PLL will cause issues for these downstream RCGs and has been shown to prevent them from being re-parented.

Follow downstream and skip configuration if it's determined that the PLL is already running.

Fixes 59128c20a6a9 ("clk: qcom: clk-alpha-pll: Add support for controlling Lucid PLLs")
drivers/clk/qcom/clk-alpha-pll.c +9 -0
index eaedcceb766f..8f65b9bdafce 100644
@@ -1429,6 +1429,15 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_fabia_ops);
 void clk_trion_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
 			     const struct alpha_pll_config *config)
 {
+	/*
+	 * If the bootloader left the PLL enabled it's likely that there are
+	 * RCGs that will lock up if we disable the PLL below.
+	 */
+	if (trion_pll_is_enabled(pll, regmap)) {
+		pr_debug("Trion PLL is already enabled, skipping configuration\n");
+		return;
+	}
+
 	clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);
 	regmap_write(regmap, PLL_CAL_L_VAL(pll), TRION_PLL_CAL_VAL);
 	clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);