From: mturquette@ti.com (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is enabled
Date: Tue, 1 May 2012 18:42:58 -0700 [thread overview]
Message-ID: <20120502014258.GD17311@gmail.com> (raw)
In-Reply-To: <b9cb6ed1e4bf0f777873b142d88cedfc520023b2.1334140283.git.viresh.kumar@st.com>
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
>
prev parent reply other threads:[~2012-05-02 1:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120502014258.GD17311@gmail.com \
--to=mturquette@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.