Skip to content

Commit ef087b7

Browse files
computersforpeacemmind
authored andcommitted
clk: rockchip: rk3399: make CPU clocks critical
The CPU clocks don't currently have any owner (e.g., cpufreq-dt doesn't enable() them -- and even if it did, it's not early enough compared to other consumers -- nor does arch/arm64/kernel/smp.c), and instead are simply assumed to be "on" all the time. They are also parents of a few other clocks which haven't been previously exposed for other devices to consume. If we want to expose those clocks, then the common clock framework may eventually choose to disable their parents (including the CPU PLLs) -- which is no fun for anyone. Thus, mark the CPU clocks as critical, to prevent them from being disabled implicitly. Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/20210908111337.v2.1.I006bb36063555079b1a88f01d20e38d7e4705ae0@changeid Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 6880fa6 commit ef087b7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/clk/rockchip/clk-rk3399.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,10 @@ static const char *const rk3399_cru_critical_clocks[] __initconst = {
15141514
"aclk_vio_noc",
15151515

15161516
/* ddrc */
1517-
"sclk_ddrc"
1517+
"sclk_ddrc",
1518+
1519+
"armclkl",
1520+
"armclkb",
15181521
};
15191522

15201523
static const char *const rk3399_pmucru_critical_clocks[] __initconst = {
@@ -1549,9 +1552,6 @@ static void __init rk3399_clk_init(struct device_node *np)
15491552
rockchip_clk_register_branches(ctx, rk3399_clk_branches,
15501553
ARRAY_SIZE(rk3399_clk_branches));
15511554

1552-
rockchip_clk_protect_critical(rk3399_cru_critical_clocks,
1553-
ARRAY_SIZE(rk3399_cru_critical_clocks));
1554-
15551555
rockchip_clk_register_armclk(ctx, ARMCLKL, "armclkl",
15561556
mux_armclkl_p, ARRAY_SIZE(mux_armclkl_p),
15571557
&rk3399_cpuclkl_data, rk3399_cpuclkl_rates,
@@ -1562,6 +1562,9 @@ static void __init rk3399_clk_init(struct device_node *np)
15621562
&rk3399_cpuclkb_data, rk3399_cpuclkb_rates,
15631563
ARRAY_SIZE(rk3399_cpuclkb_rates));
15641564

1565+
rockchip_clk_protect_critical(rk3399_cru_critical_clocks,
1566+
ARRAY_SIZE(rk3399_cru_critical_clocks));
1567+
15651568
rockchip_register_softrst(np, 21, reg_base + RK3399_SOFTRST_CON(0),
15661569
ROCKCHIP_SOFTRST_HIWORD_MASK);
15671570

0 commit comments

Comments
 (0)