[v2,2/2] clk: sunxi-ng: h616: Register GPU PLL notifier before mux notifier

Message ID 20261116-h616-pll-output-gate-v2-2-a418026ffae6@gmail.com (mailing list archive)
State New
Headers
Series clk: sunxi-ng: h616: PLL output gate and GPU notifier order |

Commit Message

Arun Iyengar via B4 Relay Nov. 16, 2026, 8:45 a.m. UTC
From: Arun Iyengar <aiyengar1990@gmail.com>

Register the GPU PLL notifier first, so the GPU goes back to the PLL
only after it has re-locked, as required by commit 02ae2bc6febd
("clk: sunxi-ng: Add clk notifier to gate then ungate PLL clocks").
Commit 0ec5e7572ddc ("clk: sunxi-ng: h616: register CPU PLL notifier
before mux notifier") did this for the CPU.

Fixes: eb963d7948ce ("clk: sunxi-ng: h616: Reparent GPU clock during frequency changes")
Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
 drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h616.c b/drivers/clk/sunxi-ng/ccu-sun50i-h616.c
index 4037c5f022a8..8f53605eaafa 100644
--- a/drivers/clk/sunxi-ng/ccu-sun50i-h616.c
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-h616.c
@@ -1254,13 +1254,16 @@  static int sun50i_h616_ccu_probe(struct platform_device *pdev)
 	ccu_mux_notifier_register(pll_cpux_clk.common.hw.clk,
 				  &sun50i_h616_cpu_nb);
 
+	/*
+	 * Re-lock the GPU PLL after any rate changes. Must be registered
+	 * before the mux notifier, so GPU goes back to a locked PLL.
+	 */
+	ccu_pll_notifier_register(&sun50i_h616_pll_gpu_nb);
+
 	/* Reparent GPU during GPU PLL rate changes */
 	ccu_mux_notifier_register(pll_gpu_clk.common.hw.clk,
 				  &sun50i_h616_gpu_nb);
 
-	/* Re-lock the GPU PLL after any rate changes */
-	ccu_pll_notifier_register(&sun50i_h616_pll_gpu_nb);
-
 	return 0;
 }