Skip to content

Commit

Permalink
clk: use atomic runtime pm api in clk_core_is_enabled
Browse files Browse the repository at this point in the history
Current clk_pm_runtime_put is using pm_runtime_put_sync which
is not safe to be called in clk_core_is_enabled as it should
be able to run in atomic context.

Thus use pm_runtime_put instead which is atomic safe.

Cc: Stephen Boyd <[email protected]>
Cc: Michael Turquette <[email protected]>
Cc: Ulf Hansson <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Fixes: 9a34b45 ("clk: Add support for runtime PM")
Signed-off-by: Dong Aisheng <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
  • Loading branch information
Dong Aisheng authored and bebarino committed Dec 27, 2017
1 parent 61d2f2a commit 756efe1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ static bool clk_core_is_enabled(struct clk_core *core)

ret = core->ops->is_enabled(core->hw);
done:
clk_pm_runtime_put(core);
if (core->dev)
pm_runtime_put(core->dev);

return ret;
}
Expand Down

0 comments on commit 756efe1

Please sign in to comment.