Feature #8785
open[linux:drivers:clk] Correct usage of clock API
0%
Description
Clock activation consists of two parts: preparing(may be complex and include sleep operations) and enabling(must not sleep).
It is allowed to call clk_prepare() several times, but it is required to call clk_unprepare() the same number of times.
The same is true for clk_enable()/clk_disable().
[linux:drivers:clk1] disable and unprepare all clks before module unload
All clks enabled and prepared by a module should be disabled and unprepared before the module unload.
Links
Sample bugfixes:
97ccd4a
51562cd
[linux:drivers:clk2] clk_prepare() and clk_enable() must be called before clk_unprepare() and clk_disable() correspondingly
clk_unprepare() should not be called if clk is not prepared, i.e. number of prior calls to clk_prepare() should be greater than number of prior calls to clk_unprepare() for that clock.
clk_disable() should not be called if clk is not enabled, i.e. number of prior calls to clk_enable() should be greater than number of prior calls to clk_disable() for that clock.
Links
Sample bugfixes:
c822fb5
d8e172f
[linux:drivers:clk3] clk_prepare() must be called before clk_enable()
Updated by Evgeny Novikov over 6 years ago
I found #3608 which looks quite similar to this one. Perhaps, it has sense to move this description there and close this feature request as a duplicate.