From: Ulf Hansson <redacted>
To implement support for the smp_twd clock for ux500 several steps
was needed. This patchseries has also proposed some new changes in the
common clock core, which the ux500 smp_twd clock definition are
relying on.
Moreover some crossdepency exist to the ux500 prcmu mfd driver.
My idea is that the corresponding maintainers may be able to ack these
changes, if they like them of course, so we can merge this through
Mike Turquette's clk git tree. Otherwise I can happily set up some other
way forward, if that suits better.
Patches is based upon Linux 3.6 rc2. The clock patches specific for ux500,
is based upon the series [PATCH V2 0/4] clk: Convert ARM ux500 to common
clock.
Michel Jaouen (1):
mfd: dbx500: Provide a more accurate smp_twd clock
Ulf Hansson (3):
clk: Provide option for clk_get_rate to issue hw for new rate
clk: ux500: Support for prmcu_rate clock
clk: ux500: Define smp_twd clock for u8500
drivers/clk/clk.c | 43 +++++++++++++++++++++-----------------
drivers/clk/ux500/clk-prcmu.c | 14 +++++++++++++
drivers/clk/ux500/clk.h | 5 +++++
drivers/clk/ux500/u8500_clk.c | 12 +++++++----
drivers/mfd/db8500-prcmu.c | 42 +++++++++++++++++++++++++++++++++++++
drivers/mfd/dbx500-prcmu-regs.h | 4 +++-
include/linux/clk-provider.h | 1 +
include/linux/mfd/dbx500-prcmu.h | 1 +
8 files changed, 98 insertions(+), 24 deletions(-)
--
1.7.10
From: Ulf Hansson <redacted>
By using CLK_GET_RATE_NOCACHE flag, we tell the clk_get_rate API to
issue the hw for an updated clock rate. This can be used for a clock
which rate may be updated without a client necessary modifying it.
Signed-off-by: Ulf Hansson <redacted>
---
drivers/clk/clk.c | 43 +++++++++++++++++++++++-------------------
include/linux/clk-provider.h | 1 +
2 files changed, 25 insertions(+), 19 deletions(-)
@@ -26,6 +26,7 @@#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */+#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */structclk_hw;
From: Michel Jaouen <redacted>
The local timer clock is based on ARM subsystem clock. This patch
obtains a more exact value of that clock by reading PRCMU registers.
Using this increases the accuracy of the local timer events.
Signed-off-by: Ulf Hansson <redacted>
Signed-off-by: Rickard Andersson <redacted>
Signed-off-by: Michel Jaouen <redacted>
---
drivers/mfd/db8500-prcmu.c | 42 ++++++++++++++++++++++++++++++++++++++
drivers/mfd/dbx500-prcmu-regs.h | 4 +++-
include/linux/mfd/dbx500-prcmu.h | 1 +
3 files changed, 46 insertions(+), 1 deletion(-)
From: Ulf Hansson <redacted>
The smp_twd clock is based upon a prcmu_rate clock type
for the PRCMU_ARMSS clock.
Signed-off-by: Ulf Hansson <redacted>
---
drivers/clk/ux500/u8500_clk.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
From: Ulf Hansson <redacted>
The prmcu_rate clock is not gateable and has a rate which
only can be fetched.
Signed-off-by: Ulf Hansson <redacted>
---
drivers/clk/ux500/clk-prcmu.c | 14 ++++++++++++++
drivers/clk/ux500/clk.h | 5 +++++
2 files changed, 19 insertions(+)
From: Mike Turquette <hidden> Date: 2012-08-31 19:29:26
Quoting Ulf Hansson (2012-08-31 05:21:28)
From: Ulf Hansson <redacted>
By using CLK_GET_RATE_NOCACHE flag, we tell the clk_get_rate API to
issue the hw for an updated clock rate. This can be used for a clock
which rate may be updated without a client necessary modifying it.
I'm glad to see this. We discussed whether the default behavior should
be cached or from the hardware at length some time back, so having a
flag to support the non-default is great.
This is a bit subtle. Calling __clk_recalc_rates will walk the subtree
of children recalculating rates as well as firing off notifiers. Is
this what you want? If your clock changes rates behind your back AND
has chilren then this is probably the right thing to do. However you
might be better off with:
if (clk && (clk->flags & CLK_GET_RATE_NOCACHE))
rate = clk->ops->recalc_rate(clk->hw, clk->parent->rate);
This doesn't update children or fire off notifiers. What is best for
your platform?
Regards,
Mike
quoted hunk
+
+ rate = __clk_get_rate(clk);
+ mutex_unlock(&prepare_lock);
+
+ return rate;
+}
+EXPORT_SYMBOL_GPL(clk_get_rate);
+
+/**
* __clk_speculate_rates
* @clk: first clk in the subtree
* @parent_rate: the "future" rate of clk's parent
@@ -26,6 +26,7 @@#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */+#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */structclk_hw;
On Fri, Aug 31, 2012 at 2:21 PM, Ulf Hansson [off-list ref] wrote:
From: Ulf Hansson <redacted>
To implement support for the smp_twd clock for ux500 several steps
was needed. This patchseries has also proposed some new changes in the
common clock core, which the ux500 smp_twd clock definition are
relying on.
This is a great series,
Acked-by: Linus Walleij <redacted>
For the ux500 parts.
Mike it'd be great if you could merge this once you have the semantics
of [1/4] sorted out with Ulf.
Yours,
Linus Walleij
Hi Mike,
Thanks for your input, and sorry for my late reply!
On 31 August 2012 21:29, Mike Turquette [off-list ref] wrote:
Quoting Ulf Hansson (2012-08-31 05:21:28)
quoted
From: Ulf Hansson <redacted>
By using CLK_GET_RATE_NOCACHE flag, we tell the clk_get_rate API to
issue the hw for an updated clock rate. This can be used for a clock
which rate may be updated without a client necessary modifying it.
I'm glad to see this. We discussed whether the default behavior should
be cached or from the hardware at length some time back, so having a
flag to support the non-default is great.
This is a bit subtle. Calling __clk_recalc_rates will walk the subtree
of children recalculating rates as well as firing off notifiers. Is
this what you want? If your clock changes rates behind your back AND
has chilren then this is probably the right thing to do. However you
might be better off with:
if (clk && (clk->flags & CLK_GET_RATE_NOCACHE))
rate = clk->ops->recalc_rate(clk->hw, clk->parent->rate);
This doesn't update children or fire off notifiers. What is best for
your platform?
For my platform, ux500 and for the clock connected to this
patchseries, your suggesting above is enough. (Well some additional
error handling is needed in your code proposal though :-) )
The reason for why I used "__clk_recalc_rates" was because I think it
could make sense to have a more generic approach, not sure if it is
needed as you mention. Additionally, using __clk_recalc_rates with
"0" as the notification argument, should prevent notifications from
happen, right?
So basically, I wanted the clock rates for the children to be updated
as well as the parent clock rate, but no notifications.
I can happily update the patch according to your proposal if you still
think it is the best way to do it, just tell me again then. :-)
Kind regards
Ulf Hansson
From: Mike Turquette <hidden> Date: 2012-09-07 00:19:27
Quoting Ulf Hansson (2012-09-06 02:09:33)
On 31 August 2012 21:29, Mike Turquette [off-list ref] wrote:
quoted
This is a bit subtle. Calling __clk_recalc_rates will walk the subtree
of children recalculating rates as well as firing off notifiers. Is
this what you want? If your clock changes rates behind your back AND
has chilren then this is probably the right thing to do. However you
might be better off with:
if (clk && (clk->flags & CLK_GET_RATE_NOCACHE))
rate = clk->ops->recalc_rate(clk->hw, clk->parent->rate);
This doesn't update children or fire off notifiers. What is best for
your platform?
For my platform, ux500 and for the clock connected to this
patchseries, your suggesting above is enough. (Well some additional
error handling is needed in your code proposal though :-) )
The reason for why I used "__clk_recalc_rates" was because I think it
could make sense to have a more generic approach, not sure if it is
needed as you mention. Additionally, using __clk_recalc_rates with
"0" as the notification argument, should prevent notifications from
happen, right?
You are right. I didn't catch that when running through this patch the
first time.
So basically, I wanted the clock rates for the children to be updated
as well as the parent clock rate, but no notifications.
This is the answer I was looking for. You DO want to walk the subtree
of children and recalc the rates. Since you are the first user of such
a feature I am happy to shape it for your needs ;-)
I can happily update the patch according to your proposal if you still
think it is the best way to do it, just tell me again then. :-)
No your patch does the right thing for your platform and looks sane and
generic for others. I feel much better about not firing off random
notifiers (which I missed when I reviewed your patch last time).
I'll take this series into clk-next.
Regards,
Mike
On 7 September 2012 10:21, Linus Walleij [off-list ref] wrote:
On Fri, Sep 7, 2012 at 3:00 AM, Turquette, Mike [off-list ref] wrote:
quoted
On Thu, Sep 6, 2012 at 5:19 PM, Mike Turquette [off-list ref] wrote:
quoted
I'll take this series into clk-next.
Oops, I forgot to ask about patch #3. Which tree do you want that to
go through?
Just take it all through your tree if there are no major conflicts.
Acked-by etc.
Agree, it makes it simpler to go through Mike's clock tree. At least
let's try it out.
I will likely have similar patch series with cross dependencies later
on, so this can be a good first test and hopefully it works.
Although, don't we need an ack by Samuel Ortiz for the patch on mfd?
"mfd: dbx500: Provide a more accurate smp_twd clock"
Or, is it enough with Linus ack since he is the maintainer of that
specific mfd file I have patched?
Kind regards
Ulf Hansson
On Fri, Sep 7, 2012 at 2:29 PM, Ulf Hansson [off-list ref] wrote:
On 7 September 2012 10:21, Linus Walleij [off-list ref] wrote:
quoted
On Fri, Sep 7, 2012 at 3:00 AM, Turquette, Mike [off-list ref] wrote:
quoted
On Thu, Sep 6, 2012 at 5:19 PM, Mike Turquette [off-list ref] wrote:
quoted
I'll take this series into clk-next.
Oops, I forgot to ask about patch #3. Which tree do you want that to
go through?
Just take it all through your tree if there are no major conflicts.
Acked-by etc.
Agree, it makes it simpler to go through Mike's clock tree. At least
let's try it out.
I will likely have similar patch series with cross dependencies later
on, so this can be a good first test and hopefully it works.
That will probably hit the next merge window anyway - these
patches will go into v3.7 as it looks, then you can finalize the
next series for v3.8.
Although, don't we need an ack by Samuel Ortiz for the patch on mfd?
"mfd: dbx500: Provide a more accurate smp_twd clock"
Confused, isn't that patch part of the latter series, and not
part of what Mike merged?
Or, is it enough with Linus ack since he is the maintainer of that
specific mfd file I have patched?
That's up to Mike, but I hardly think Sam is going to get very
angry about this if we merge it.
Yours,
Linus Walleij
From: Samuel Ortiz <hidden> Date: 2012-09-19 16:03:01
Hi Ulf,
On Fri, Aug 31, 2012 at 02:21:30PM +0200, Ulf Hansson wrote:
quoted hunk
From: Michel Jaouen <redacted>
The local timer clock is based on ARM subsystem clock. This patch
obtains a more exact value of that clock by reading PRCMU registers.
Using this increases the accuracy of the local timer events.
Signed-off-by: Ulf Hansson <redacted>
Signed-off-by: Rickard Andersson <redacted>
Signed-off-by: Michel Jaouen <redacted>
---
drivers/mfd/db8500-prcmu.c | 42 ++++++++++++++++++++++++++++++++++++++
drivers/mfd/dbx500-prcmu-regs.h | 4 +++-
include/linux/mfd/dbx500-prcmu.h | 1 +
3 files changed, 46 insertions(+), 1 deletion(-)
I'm not a big fan of forward declarations, but I still applied your patch to
my for-next branch. Thanks.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
From: Mike Turquette <hidden> Date: 2012-09-19 16:42:42
Quoting Samuel Ortiz (2012-09-19 09:02:51)
Hi Ulf,
On Fri, Aug 31, 2012 at 02:21:30PM +0200, Ulf Hansson wrote:
quoted
From: Michel Jaouen <redacted>
The local timer clock is based on ARM subsystem clock. This patch
obtains a more exact value of that clock by reading PRCMU registers.
Using this increases the accuracy of the local timer events.
Signed-off-by: Ulf Hansson <redacted>
Signed-off-by: Rickard Andersson <redacted>
Signed-off-by: Michel Jaouen <redacted>
---
drivers/mfd/db8500-prcmu.c | 42 ++++++++++++++++++++++++++++++++++++++
drivers/mfd/dbx500-prcmu-regs.h | 4 +++-
include/linux/mfd/dbx500-prcmu.h | 1 +
3 files changed, 46 insertions(+), 1 deletion(-)
I'm not a big fan of forward declarations, but I still applied your patch to
my for-next branch. Thanks.
Samuel,
Not sure if you were Cc'd on the rest of the patches in this series but
after some discussion (see patch #1) I took all four patches into
clk-next, including the MFD change. This was done first week of
September. At this point those patches have shifted into my stable
branch that I have promised not to rebase (for arm-soc dependencies).
Are you OK with me taking this patch through the clk-next branch?
Regards,
Mike
From: Samuel Ortiz <hidden> Date: 2012-09-19 16:56:08
Hi Mike,
On Wed, Sep 19, 2012 at 09:42:31AM -0700, Mike Turquette wrote:
Quoting Samuel Ortiz (2012-09-19 09:02:51)
quoted
Hi Ulf,
On Fri, Aug 31, 2012 at 02:21:30PM +0200, Ulf Hansson wrote:
quoted
From: Michel Jaouen <redacted>
The local timer clock is based on ARM subsystem clock. This patch
obtains a more exact value of that clock by reading PRCMU registers.
Using this increases the accuracy of the local timer events.
Signed-off-by: Ulf Hansson <redacted>
Signed-off-by: Rickard Andersson <redacted>
Signed-off-by: Michel Jaouen <redacted>
---
drivers/mfd/db8500-prcmu.c | 42 ++++++++++++++++++++++++++++++++++++++
drivers/mfd/dbx500-prcmu-regs.h | 4 +++-
include/linux/mfd/dbx500-prcmu.h | 1 +
3 files changed, 46 insertions(+), 1 deletion(-)
I'm not a big fan of forward declarations, but I still applied your patch to
my for-next branch. Thanks.
Samuel,
Not sure if you were Cc'd on the rest of the patches in this series but
after some discussion (see patch #1) I took all four patches into
clk-next, including the MFD change. This was done first week of
September. At this point those patches have shifted into my stable
branch that I have promised not to rebase (for arm-soc dependencies).
Are you OK with me taking this patch through the clk-next branch?
Yes, I'm fine with it.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/