clk: Fixup locking issues for clk_set_parent
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 2 Apr 2013 21:09:39 +0000 (23:09 +0200)
committerMike Turquette <mturquette@linaro.org>
Tue, 9 Apr 2013 01:19:40 +0000 (18:19 -0700)
commita68de8e4ab2756d8e125cf327f044c895b6a6b3d
tree889c89b211daef76880c3563f20b2423fca771c7
parent031dcc9bd4164a7482b89987d5b9ecb3af5e9033
clk: Fixup locking issues for clk_set_parent

Updating the clock tree topology must be protected with the spinlock
when doing clk_set_parent, otherwise we can not handle the migration
of the enable_count in a safe manner.

While issuing the .set_parent callback to make the clk-hw perform the
switch to the new parent, we can not hold the spinlock since it is must
be allowed to be slow path. This complicates error handling, but is still
possible to achieve.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/clk.c