Commit 0e1c0301 authored by Viresh Kumar's avatar Viresh Kumar Committed by Mike Turquette

clk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is enabled

This is well documented but isn't implemented. clk_set_rate() must check if
flags have CLK_SET_RATE_GATE bit set and is enabled too.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
parent 0197b3ea
...@@ -900,6 +900,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate) ...@@ -900,6 +900,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
if (rate == clk->rate) if (rate == clk->rate)
goto out; goto out;
if ((clk->flags & CLK_SET_RATE_GATE) && __clk_is_enabled(clk)) {
ret = -EBUSY;
goto out;
}
/* calculate new rates and get the topmost changed clock */ /* calculate new rates and get the topmost changed clock */
top = clk_calc_new_rates(clk, rate); top = clk_calc_new_rates(clk, rate);
if (!top) { if (!top) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment