]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
clk: actually call the clock init before any other callback of the clock
authorJerome Brunet <jbrunet@baylibre.com>
Tue, 24 Sep 2019 12:39:52 +0000 (14:39 +0200)
committerStephen Boyd <sboyd@kernel.org>
Tue, 24 Dec 2019 02:53:13 +0000 (18:53 -0800)
 __clk_init_parent() will call the .get_parent() callback of the clock
 so .init() must run before.

Fixes: 541debae0adf ("clk: call the clock init() callback before any other ops callback")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lkml.kernel.org/r/20190924123954.31561-2-jbrunet@baylibre.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk.c

index b68e200829f202d78f49af69cd20c291f0d92022..676e40deefcfc5a8858df72ed7519ddda91543c1 100644 (file)
@@ -3312,6 +3312,21 @@ static int __clk_core_init(struct clk_core *core)
                goto out;
        }
 
+       /*
+        * optional platform-specific magic
+        *
+        * The .init callback is not used by any of the basic clock types, but
+        * exists for weird hardware that must perform initialization magic.
+        * Please consider other ways of solving initialization problems before
+        * using this callback, as its use is discouraged.
+        *
+        * If it exist, this callback should called before any other callback of
+        * the clock
+        */
+       if (core->ops->init)
+               core->ops->init(core->hw);
+
+
        core->parent = __clk_init_parent(core);
 
        /*
@@ -3336,17 +3351,6 @@ static int __clk_core_init(struct clk_core *core)
                core->orphan = true;
        }
 
-       /*
-        * optional platform-specific magic
-        *
-        * The .init callback is not used by any of the basic clock types, but
-        * exists for weird hardware that must perform initialization magic.
-        * Please consider other ways of solving initialization problems before
-        * using this callback, as its use is discouraged.
-        */
-       if (core->ops->init)
-               core->ops->init(core->hw);
-
        /*
         * Set clk's accuracy.  The preferred method is to use
         * .recalc_accuracy. For simple clocks and lazy developers the default