diff mbox

[01/13] clk: core: correct clk_set_rate kerneldoc

Message ID 1334192572-12499-2-git-send-email-mturquette@linaro.org
State Accepted
Commit 5654dc94f872f823aa13941a8fdba69a3feca39c
Headers show

Commit Message

Mike Turquette April 12, 2012, 1:02 a.m. UTC
Remove old and misleading documentation from the previous clk_set_rate
implementaion.

Reported-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Cc: Arnd Bergman <arnd.bergmann@linaro.org>
Cc: Olof Johansson <olof@lixom.net>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawn.guo@freescale.com>
Cc: Richard Zhao <richard.zhao@linaro.org>
Cc: Saravana Kannan <skannan@codeaurora.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Viresh Kumar <viresh.kumar@st.com>
---
 drivers/clk/clk.c |   41 +++++++++++------------------------------
 1 files changed, 11 insertions(+), 30 deletions(-)

Comments

Viresh Kumar April 12, 2012, 4:28 a.m. UTC | #1
On 4/12/2012 6:32 AM, Mike Turquette wrote:
> - * If clk has the CLK_SET_RATE_GATE flag set and it is enabled this call
> - * will fail; only when the clk is disabled will it be able to change
> - * its rate.

Why is CLK_SET_RATE_GATE removed? I already sent a patch to fix clk_set_rate()
for this. And i think it should be required.
Andrew Lunn April 12, 2012, 7:24 a.m. UTC | #2
Hi Mike

A general question to all these patches.

Do you want to get them into 3.4-rc, or linux-next?

   Thanks
	Andrew
Amit Kucheria April 12, 2012, 7:38 a.m. UTC | #3
On Thu, Apr 12, 2012 at 10:24 AM, Andrew Lunn <andrew@lunn.ch> wrote:
> Hi Mike
>
> A general question to all these patches.
>
> Do you want to get them into 3.4-rc, or linux-next?
>
>   Thanks
>        Andrew

In 0/13, I think he did ask Arnd to take these in for 3.4-rc even if
they are not strictly bug fixes, since this is a new framework. Up to
the arm-soc maintainers now.

/Amit
Mike Turquette April 13, 2012, 10:23 p.m. UTC | #4
On Wed, Apr 11, 2012 at 9:28 PM, Viresh Kumar <viresh.kumar@st.com> wrote:
> On 4/12/2012 6:32 AM, Mike Turquette wrote:
>> - * If clk has the CLK_SET_RATE_GATE flag set and it is enabled this call
>> - * will fail; only when the clk is disabled will it be able to change
>> - * its rate.
>
> Why is CLK_SET_RATE_GATE removed? I already sent a patch to fix clk_set_rate()
> for this. And i think it should be required.

I removed it from the documentation since it was not present in the
code.  I was originally targeting this for an -rc and I was trying to
limit the changes purely to fixes and cleanups, not new features.

I haven't finished digging through all of the responses yet, so my
goal for where these patches are headed might change.

Regards,
Mike
diff mbox

Patch

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 9cf6f59..3ed36d3 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -859,38 +859,19 @@  static void clk_change_rate(struct clk *clk)
  * @clk: the clk whose rate is being changed
  * @rate: the new rate for clk
  *
- * In the simplest case clk_set_rate will only change the rate of clk.
+ * In the simplest case clk_set_rate will only adjust the rate of clk.
  *
- * If clk has the CLK_SET_RATE_GATE flag set and it is enabled this call
- * will fail; only when the clk is disabled will it be able to change
- * its rate.
+ * Setting the CLK_SET_RATE_PARENT flag allows the rate change operation to
+ * propagate up to clk's parent; whether or not this happens depends on the
+ * outcome of clk's .round_rate implementation.  If *parent_rate is unchanged
+ * after calling .round_rate then upstream parent propagation is ignored.  If
+ * *parent_rate comes back with a new rate for clk's parent then we propagate
+ * up to clk's parent and set it's rate.  Upward propagation will continue
+ * until either a clk does not support the CLK_SET_RATE_PARENT flag or
+ * .round_rate stops requesting changes to clk's parent_rate.
  *
- * Setting the CLK_SET_RATE_PARENT flag allows clk_set_rate to
- * recursively propagate up to clk's parent; whether or not this happens
- * depends on the outcome of clk's .round_rate implementation.  If
- * *parent_rate is 0 after calling .round_rate then upstream parent
- * propagation is ignored.  If *parent_rate comes back with a new rate
- * for clk's parent then we propagate up to clk's parent and set it's
- * rate.  Upward propagation will continue until either a clk does not
- * support the CLK_SET_RATE_PARENT flag or .round_rate stops requesting
- * changes to clk's parent_rate.  If there is a failure during upstream
- * propagation then clk_set_rate will unwind and restore each clk's rate
- * that had been successfully changed.  Afterwards a rate change abort
- * notification will be propagated downstream, starting from the clk
- * that failed.
- *
- * At the end of all of the rate setting, clk_set_rate internally calls
- * __clk_recalc_rates and propagates the rate changes downstream,
- * starting from the highest clk whose rate was changed.  This has the
- * added benefit of propagating post-rate change notifiers.
- *
- * Note that while post-rate change and rate change abort notifications
- * are guaranteed to be sent to a clk only once per call to
- * clk_set_rate, pre-change notifications will be sent for every clk
- * whose rate is changed.  Stacking pre-change notifications is noisy
- * for the drivers subscribed to them, but this allows drivers to react
- * to intermediate clk rate changes up until the point where the final
- * rate is achieved at the end of upstream propagation.
+ * Rate changes are accomplished via tree traversal that also recalculates the
+ * rates for the clocks and fires off POST_RATE_CHANGE notifiers.
  *
  * Returns 0 on success, -EERROR otherwise.
  */