diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2015-02-06 09:13:01 -0500 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2015-02-19 22:29:19 -0500 |
commit | ec02ace8ca0a50eef430d3676de5c5fa978b0e29 (patch) | |
tree | 144c997964757068bc27ecdbd7c02ce9611e12b7 /drivers | |
parent | a92614879128b8f797f0b3119ef42a129be5eded (diff) |
clk: Only recalculate the rate if needed
We don't really need to recalculate the effective rate of a clock when a
per-user clock is removed, if the constraints of the later aren't
limiting the requested rate.
This was causing problems with clocks that never had a rate set before,
as rate_req would be zero. Though this could be considered a bug in the
implementation of those clocks, this should be checked somewhere else.
Fixes: 1c8e600440c7 ("clk: Add rate constraints to clocks")
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/clk.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index f3a7a4425242..a27f14116cc9 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
@@ -2664,7 +2664,10 @@ void __clk_put(struct clk *clk) | |||
2664 | clk_prepare_lock(); | 2664 | clk_prepare_lock(); |
2665 | 2665 | ||
2666 | hlist_del(&clk->child_node); | 2666 | hlist_del(&clk->child_node); |
2667 | clk_core_set_rate_nolock(clk->core, clk->core->req_rate); | 2667 | if (clk->min_rate > clk->core->req_rate || |
2668 | clk->max_rate < clk->core->req_rate) | ||
2669 | clk_core_set_rate_nolock(clk->core, clk->core->req_rate); | ||
2670 | |||
2668 | owner = clk->core->owner; | 2671 | owner = clk->core->owner; |
2669 | kref_put(&clk->core->ref, __clk_release); | 2672 | kref_put(&clk->core->ref, __clk_release); |
2670 | 2673 | ||