Project

General

Profile

Actions

Feature #8785

open

[linux:drivers:clk] Correct usage of clock API

Added by Alexey Khoroshilov over 6 years ago. Updated over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Published in build:

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()

Actions

Also available in: Atom PDF