clk: add missing lock when call clk_core_enable in clk_set_parent
authorDong Aisheng <aisheng.dong@freescale.com>
Wed, 15 Apr 2015 14:26:36 +0000 (22:26 +0800)
committerStephen Boyd <sboyd@codeaurora.org>
Wed, 6 May 2015 23:58:53 +0000 (16:58 -0700)
commitd2a5d46b167a9a8231264daf80165b739aecf1d7
treeaacc2fe63fde97d4263fbb9a2487a6dbc3fc01e3
parent5d45ed8f5bfaeaf50576b8d663796ee905ccf2a0
clk: add missing lock when call clk_core_enable in clk_set_parent

Before commit 035a61c314eb ("clk: Make clk API return per-user
struct clk instances") we acquired the enable_lock in
__clk_set_parent_{before,after}() by means of calling
clk_enable(). After commit 035a61c314eb we use clk_core_enable()
in place of the clk_enable(), and clk_core_enable() doesn't
acquire the enable_lock. This opens up a race condition between
clk_set_parent() and clk_enable(). Fix it.

Fixes: 035a61c314eb ("clk: Make clk API return per-user struct clk instances")
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk.c