]> git.baikalelectronics.ru Git - kernel.git/commit
clk: walk orphan list on clock provider registration
authorJerome Brunet <jbrunet@baylibre.com>
Tue, 3 Dec 2019 08:08:05 +0000 (09:08 +0100)
committerStephen Boyd <sboyd@kernel.org>
Fri, 13 Dec 2019 02:54:08 +0000 (18:54 -0800)
commitb536f57ccab4c5b47e46555a41b3676717c9ab3c
tree93287f8693587ceada3b920b02fafbc8c911366a
parent47599c6298943ede4662b5e31dfe375feac1b48a
clk: walk orphan list on clock provider registration

So far, we walked the orphan list every time a new clock was registered
in CCF. This was fine since the clocks were only referenced by name.

Now that the clock can be referenced through DT, it is not enough:
* Controller A register first a reference clocks from controller B
  through DT.
* Controller B register all its clocks then register the provider.

Each time controller B registers a new clock, the orphan list is walked
but it can't match since the provider is registered yet. When the
provider is finally registered, the orphan list is not walked unless
another clock is registered afterward.

This can lead to situation where some clocks remain orphaned even if
the parent is available.

Walking the orphan list on provider registration solves the problem.

Reported-by: Jian Hu <jian.hu@amlogic.com>
Fixes: f8441069c1d5 ("clk: Allow parents to be specified without string names")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lkml.kernel.org/r/20191203080805.104628-1-jbrunet@baylibre.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk.c