All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is enabled
@ 2012-04-11 10:33 Viresh Kumar
  2012-05-02  1:42 ` Mike Turquette
  0 siblings, 1 reply; 2+ messages in thread
From: Viresh Kumar @ 2012-04-11 10:33 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Untested patch.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 drivers/clk/clk.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 9d11c19..65dc35d 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -905,6 +905,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 	if (rate == clk->rate)
 		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 */
 	top = clk_calc_new_rates(clk, rate);
 	if (!top) {
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] clk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is enabled
  2012-04-11 10:33 [PATCH] clk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is enabled Viresh Kumar
@ 2012-05-02  1:42 ` Mike Turquette
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Turquette @ 2012-05-02  1:42 UTC (permalink / raw)
  To: linux-arm-kernel

On 20120411-16:03, Viresh Kumar wrote:
> 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.
> 
> Untested patch.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>

Tested and pulled into clk-next.

Thanks,
Mike

> ---
>  drivers/clk/clk.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 9d11c19..65dc35d 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -905,6 +905,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
>  	if (rate == clk->rate)
>  		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 */
>  	top = clk_calc_new_rates(clk, rate);
>  	if (!top) {
> -- 
> 1.7.9
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-02  1:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 10:33 [PATCH] clk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is enabled Viresh Kumar
2012-05-02  1:42 ` Mike Turquette

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.