Re: [PATCH 1/1] clk: Add notifier support in clk_prepare/clk_unprepare

2013-03-20 Thread Ulf Hansson
;> really do the voltage scaling. >> >> Tegra devfreq driver will register clock notifiers on all its interested >> clock and hence when any of those clock rate changes, disabled, enabled, >> we'll specifically call updat

Re: [RFC 1/1] clk: Add notifier support in clk_prepare_enable/clk_disable_unprepare

2013-03-18 Thread Ulf Hansson
On 15 March 2013 20:38, Stephen Warren wrote: > On 03/15/2013 06:33 AM, Ulf Hansson wrote: >> On 15 March 2013 13:06, Bill Huang wrote: >>> On Fri, 2013-03-15 at 18:08 +0800, Ulf Hansson wrote: > ... >>>> Some prerequisites; I think am in favor of using the clk

Re: [RFC 1/1] clk: Add notifier support in clk_prepare_enable/clk_disable_unprepare

2013-03-15 Thread Ulf Hansson
On 15 March 2013 13:06, Bill Huang wrote: > On Fri, 2013-03-15 at 18:08 +0800, Ulf Hansson wrote: >> On 15 March 2013 10:39, Peter De Schrijver wrote: >> > On Fri, Mar 15, 2013 at 06:22:47AM +0100, Stephen Warren wrote: >> >> On 03/14/2013 07:20 PM, Bill Huang wro

Re: [RFC 1/1] clk: Add notifier support in clk_prepare_enable/clk_disable_unprepare

2013-03-15 Thread Ulf Hansson
n this topic; Some prerequisites; I think am in favor of using the clk API to trigger DVFS changes and then I agree on that clk_prepare|unprepare needs to be possible to track from a DVFS perspective. clk_set_rate is not enough. So if we decide to do the above (using the clk API to trigger DVFS changes), I believe we should discuss two possible solutions; - clk notifiers or.. - dvfs clock type. I am trying to make up my mind of what I think is the best solution. Have you considered "dvfs clock type"? I put some comments about this for "[PATCH 2/5] clk: notifier handler for dynamic voltage scaling" recently as well. What could the advantages/disadvantages be between the two options? Kind regards Ulf Hansson ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev

Re: [PATCH 2/5] clk: notifier handler for dynamic voltage scaling

2013-03-13 Thread Ulf Hansson
first solution. Likely less code in each driver but still "DVFS intelligence" need to exist there. > > A hybrid solution might be to set a flag on a clock (e.g. > CLK_SET_RATE_DVFS) which tells the clk framework that this clock is > special and clk_set_rate should call d

Re: [PATCH 1/5] clk: allow reentrant calls into the clk framework

2013-02-28 Thread Ulf Hansson
_reentrant()) { > + parent = __clk_get_parent(clk); > + goto out; > + } > + > + clk_fwk_lock(); > parent = __clk_get_parent(clk); > - mutex_unlock(&prepare_lock); > + clk_fwk_unlock(); > > +out: > return parent; > } > EXPORT_SYMBOL_GPL(clk_get_parent); > @@ -1293,6 +1405,7 @@ out: > int clk_set_parent(struct clk *clk, struct clk *parent) > { > int ret = 0; > + bool reenter; > > if (!clk || !clk->ops) > return -EINVAL; > @@ -1300,8 +1413,10 @@ int clk_set_parent(struct clk *clk, struct clk *parent) > if (!clk->ops->set_parent) > return -ENOSYS; > > - /* prevent racing with updates to the clock topology */ > - mutex_lock(&prepare_lock); > + reenter = clk_is_reentrant(); > + > + if (!reenter) > + clk_fwk_lock(); > > if (clk->parent == parent) > goto out; > @@ -1330,7 +1445,8 @@ int clk_set_parent(struct clk *clk, struct clk *parent) > __clk_reparent(clk, parent); > > out: > - mutex_unlock(&prepare_lock); > + if (!reenter) > + clk_fwk_unlock(); > > return ret; > } > -- > 1.7.10.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ Kind regards Ulf Hansson ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev