linux-stable/drivers/clk/samsung
Sam Protsenko bcda841f9b clk: samsung: exynos850: Register clocks early
Some clocks must be registered before init calls. For example MCT clock
(from CMU_PERI) is needed for MCT timer driver, which is registered
with TIMER_OF_DECLARE(). By the time we get to core_initcall() used for
clk-exynos850 platform driver init, it's already too late. Inability to
get "mct" clock in MCT driver leads to kernel panic, as functions
registered with *_OF_DECLARE() can't do deferred calls. MCT timer driver
can't be fixed either, as it's acting as a clock source and it's
essential to register it in start_kernel() -> time_init().

Let's register CMU_PERI clocks early, using CLK_OF_DECLARE(). CMU_TOP
generates clocks needed for CMU_PERI, but it's already registered early.

While at it, let's cleanup the code a bit, by extracting everything
related to CMU initialization and registration to the separate function.

Similar issue was discussed at [1] and addressed in commit 1f7db7bbf0
("clk: renesas: cpg-mssr: Add early clock support"), as well as in
drivers/clk/mediatek/clk-mt2712.c.

[1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20180829132954.64862-2-chris.brandt@renesas.com/

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20211122144206.23134-1-semen.protsenko@linaro.org
2021-11-22 22:58:43 +01:00
..
clk-cpu.c clk: samsung: Update CPU clk registration 2021-11-20 14:22:49 +01:00
clk-cpu.h clk: samsung: Update CPU clk registration 2021-11-20 14:22:49 +01:00
clk-exynos-audss.c clk: samsung: exynos-audss: Make use of devm_platform_ioremap_resource() 2021-09-13 18:00:35 +02:00
clk-exynos-clkout.c clk: samsung: mark PM functions as __maybe_unused 2020-12-05 15:13:17 +01:00
clk-exynos4.c clk: samsung: Update CPU clk registration 2021-11-20 14:22:49 +01:00
clk-exynos5-subcmu.c clk: samsung: Change signature of exynos5_subcmus_init() function 2019-08-08 13:53:42 -07:00
clk-exynos5-subcmu.h clk: samsung: Change signature of exynos5_subcmus_init() function 2019-08-08 13:53:42 -07:00
clk-exynos7.c clk: exynos7: Mark aclk_fsys1_200 as critical 2021-04-07 11:37:17 +02:00
clk-exynos850.c clk: samsung: exynos850: Register clocks early 2021-11-22 22:58:43 +01:00
clk-exynos3250.c clk: samsung: Update CPU clk registration 2021-11-20 14:22:49 +01:00
clk-exynos4412-isp.c clk: samsung: exynos4412-isp: Make use of devm_platform_ioremap_resource() 2021-09-13 18:00:51 +02:00
clk-exynos5250.c clk: samsung: Update CPU clk registration 2021-11-20 14:22:49 +01:00
clk-exynos5260.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
clk-exynos5260.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
clk-exynos5410.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
clk-exynos5420.c clk: samsung: Update CPU clk registration 2021-11-20 14:22:49 +01:00
clk-exynos5433.c clk: samsung: exynos5433: update apollo and atlas clock probing 2021-10-15 16:00:17 +02:00
clk-pll.c clk: samsung: clk-pll: Implement pll0831x PLL type 2021-10-09 22:21:04 +02:00
clk-pll.h clk: samsung: clk-pll: Implement pll0831x PLL type 2021-10-09 22:21:04 +02:00
clk-s3c64xx.c clk: samsung: remove __clk_lookup() usage 2021-11-19 19:32:30 +01:00
clk-s3c2410-dclk.c ARM: s3c24xx: pass pointer to clk driver via platform data 2020-08-19 20:58:10 +02:00
clk-s3c2410.c clk: samsung: remove __clk_lookup() usage 2021-11-19 19:32:30 +01:00
clk-s3c2412.c clk: samsung: s3c24xx: declare s3c24xx_common_clk_init() in shared header 2020-08-17 18:54:33 +02:00
clk-s3c2443.c clk: samsung: s3c24xx: declare s3c24xx_common_clk_init() in shared header 2020-08-17 18:54:33 +02:00
clk-s5pv210-audss.c clk: samsung: s5pv210-audss: Make use of devm_platform_ioremap_resource() 2021-09-13 18:01:09 +02:00
clk-s5pv210.c clk: samsung: remove __clk_lookup() usage 2021-11-19 19:32:30 +01:00
clk.c clk: samsung: remove __clk_lookup() usage 2021-11-19 19:32:30 +01:00
clk.h clk: samsung: Remove meaningless __init and extern from header files 2021-11-19 19:32:36 +01:00
Kconfig clk: samsung: describe drivers in Kconfig 2021-10-18 10:12:48 +02:00
Makefile clk: samsung: Introduce Exynos850 clock driver 2021-10-15 15:37:12 +02:00