]> git.baikalelectronics.ru Git - kernel.git/commit
clk: Move rate and accuracy recalc to mostly consumer APIs
authorStephen Boyd <sboyd@kernel.org>
Wed, 5 Feb 2020 23:28:01 +0000 (15:28 -0800)
committerStephen Boyd <sboyd@kernel.org>
Wed, 12 Feb 2020 23:27:11 +0000 (15:27 -0800)
commit87aa551e108c0959f397eec6ac38cdd81b58aa1d
tree4b352a2fed2d72ea72eee48c808e91422cfd1e8a
parent1140006a261d57a44c7df69139ac6063dec26d88
clk: Move rate and accuracy recalc to mostly consumer APIs

There's some confusion about when recalc is done for the rate and
accuracy clk consumer APIs in relation to the prepare lock being taken.
Oddly enough, we take the lock again in debugfs APIs so that we can call
the internal "clk_core" APIs to get these fields with any necessary
recalculations. Instead of having this confusion, let's introduce a
recalc variant of these two consumer APIs as internal helpers and call
them from the consumer APIs and the debugfs code so that we don't take
the lock more than once.

Cc: Douglas Anderson <dianders@chromium.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20200205232802.29184-4-sboyd@kernel.org
Acked-by: Jerome Brunet <jbrunet@baylibre.com>
drivers/clk/clk.c