Skip to content

Commit 372fa10

Browse files
wensmripard
authored andcommitted
clk: sunxi-ng: a33: gate then ungate PLL CPU clk after rate change
This patch utilizes the new PLL clk notifier to gate then ungate the PLL CPU clock after rate changes. This should mitigate the system hangs observed after the introduction of cpufreq for the A33. Signed-off-by: Chen-Yu Tsai <[email protected]> Tested-by: Quentin Schulz <[email protected]> Signed-off-by: Maxime Ripard <[email protected]>
1 parent 02ae2bc commit 372fa10

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/clk/sunxi-ng/ccu-sun8i-a33.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,13 @@ static const struct sunxi_ccu_desc sun8i_a33_ccu_desc = {
752752
.num_resets = ARRAY_SIZE(sun8i_a33_ccu_resets),
753753
};
754754

755+
static struct ccu_pll_nb sun8i_a33_pll_cpu_nb = {
756+
.common = &pll_cpux_clk.common,
757+
/* copy from pll_cpux_clk */
758+
.enable = BIT(31),
759+
.lock = BIT(28),
760+
};
761+
755762
static struct ccu_mux_nb sun8i_a33_cpu_nb = {
756763
.common = &cpux_clk.common,
757764
.cm = &cpux_clk.mux,
@@ -783,6 +790,10 @@ static void __init sun8i_a33_ccu_setup(struct device_node *node)
783790

784791
sunxi_ccu_probe(node, reg, &sun8i_a33_ccu_desc);
785792

793+
/* Gate then ungate PLL CPU after any rate changes */
794+
ccu_pll_notifier_register(&sun8i_a33_pll_cpu_nb);
795+
796+
/* Reparent CPU during PLL CPU rate changes */
786797
ccu_mux_notifier_register(pll_cpux_clk.common.hw.clk,
787798
&sun8i_a33_cpu_nb);
788799
}

0 commit comments

Comments
 (0)