]> git.baikalelectronics.ru Git - kernel.git/commit
clk: migrate ref counts when orphans are reunited
authorMichael Turquette <mturquette@baylibre.com>
Fri, 8 Jul 2016 23:32:10 +0000 (16:32 -0700)
committerStephen Boyd <sboyd@codeaurora.org>
Fri, 12 Aug 2016 01:06:50 +0000 (18:06 -0700)
commit75175f4f313fa91819bd41f780fe9190165d319f
treec81655dfc23146f3a85d74ffacc71f036fab97c9
parentbbf291822c7482a8e76f6a72bf0a40c70e947852
clk: migrate ref counts when orphans are reunited

It's always nice to see families reunited, and this is equally true when
talking about parent clocks and their children. However, if the orphan
clk had a positive prepare_count or enable_count, then we would not
migrate those counts up the parent chain correctly.

This has manifested with the recent critical clocks feature, which often
enables clocks very early, before their parents have been registered.

Fixed by replacing the call to clk_core_reparent with calls to
__clk_set_parent_{before,after}.

Cc: James Liao <jamesjj.liao@mediatek.com>
Cc: Erin Lo <erin.lo@mediatek.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
[sboyd@codeaurora.org: Recalc accuracies and rates too]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk.c