linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] msm: timer: Support sched_clock()
@ 2012-02-22  1:39 Stephen Boyd
  2012-02-22 21:55 ` David Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Boyd @ 2012-02-22  1:39 UTC (permalink / raw)
  To: linux-arm-msm; +Cc: linux-kernel, linux-arm-kernel, Marc Zyngier, David Brown

Now that sched_clock is mandatory on ARM it's simple to add
sched_clock support to the MSM timer code. Add it so that we get
more accurate sched_clock output than the jiffies based version
that's provided by default.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: David Brown <davidb@codeaurora.org>
---

This is based on Marc's mandatory sched_clock patch series
located at

 git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git sched_clock-v3.3-rc3

 arch/arm/mach-msm/timer.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
index 11d0d8f..61983da 100644
--- a/arch/arm/mach-msm/timer.c
+++ b/arch/arm/mach-msm/timer.c
@@ -24,6 +24,7 @@
 #include <asm/mach/time.h>
 #include <asm/hardware/gic.h>
 #include <asm/localtimer.h>
+#include <asm/sched_clock.h>
 
 #include <mach/msm_iomap.h>
 #include <mach/cpu.h>
@@ -105,12 +106,12 @@ static union {
 
 static void __iomem *source_base;
 
-static cycle_t msm_read_timer_count(struct clocksource *cs)
+static notrace cycle_t msm_read_timer_count(struct clocksource *cs)
 {
 	return readl_relaxed(source_base + TIMER_COUNT_VAL);
 }
 
-static cycle_t msm_read_timer_count_shift(struct clocksource *cs)
+static notrace cycle_t msm_read_timer_count_shift(struct clocksource *cs)
 {
 	/*
 	 * Shift timer count down by a constant due to unreliable lower bits
@@ -127,6 +128,11 @@ static struct clocksource msm_clocksource = {
 	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
+static notrace u32 msm_sched_clock_read(void)
+{
+	return msm_clocksource.read(&msm_clocksource);
+}
+
 static void __init msm_timer_init(void)
 {
 	struct clock_event_device *ce = &msm_clockevent;
@@ -189,6 +195,8 @@ err:
 	res = clocksource_register_hz(cs, dgt_hz);
 	if (res)
 		pr_err("clocksource_register failed\n");
+	setup_sched_clock(msm_sched_clock_read,
+			cpu_is_msm7x01() ? 32 - MSM_DGT_SHIFT : 32, dgt_hz);
 }
 
 #ifdef CONFIG_LOCAL_TIMERS
-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.


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

* Re: [PATCH] msm: timer: Support sched_clock()
  2012-02-22  1:39 [PATCH] msm: timer: Support sched_clock() Stephen Boyd
@ 2012-02-22 21:55 ` David Brown
  2012-02-24 10:11   ` Marc Zyngier
  0 siblings, 1 reply; 8+ messages in thread
From: David Brown @ 2012-02-22 21:55 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: linux-arm-msm, linux-kernel, linux-arm-kernel, Marc Zyngier

On Tue, Feb 21, 2012 at 05:39:37PM -0800, Stephen Boyd wrote:
> Now that sched_clock is mandatory on ARM it's simple to add
> sched_clock support to the MSM timer code. Add it so that we get
> more accurate sched_clock output than the jiffies based version
> that's provided by default.
> 
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: David Brown <davidb@codeaurora.org>

Marc, are you able to pull this into your series, so they can all go
in together?  If so:

  Acked-by: David Brown <davidb@codeaurora.org>

Thanks,
David

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

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

* Re: [PATCH] msm: timer: Support sched_clock()
  2012-02-22 21:55 ` David Brown
@ 2012-02-24 10:11   ` Marc Zyngier
  2012-02-24 17:09     ` David Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Zyngier @ 2012-02-24 10:11 UTC (permalink / raw)
  To: David Brown; +Cc: Stephen Boyd, linux-arm-msm, linux-kernel, linux-arm-kernel

On 22/02/12 21:55, David Brown wrote:
> On Tue, Feb 21, 2012 at 05:39:37PM -0800, Stephen Boyd wrote:
>> Now that sched_clock is mandatory on ARM it's simple to add
>> sched_clock support to the MSM timer code. Add it so that we get
>> more accurate sched_clock output than the jiffies based version
>> that's provided by default.
>>
>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>> Cc: Marc Zyngier <marc.zyngier@arm.com>
>> Cc: David Brown <davidb@codeaurora.org>
> 
> Marc, are you able to pull this into your series, so they can all go
> in together?  If so:
> 
>   Acked-by: David Brown <davidb@codeaurora.org>

David, Stephen,

Russell already pulled my sched_clock() patch series, so I'm not sure it
is actually useful for me to carry it (and there is actually no
dependency between this patch and the series). Maybe putting it in the
patch system or via armsoc would be best?

Otherwise:
Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny...


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

* Re: [PATCH] msm: timer: Support sched_clock()
  2012-02-24 10:11   ` Marc Zyngier
@ 2012-02-24 17:09     ` David Brown
  2012-02-24 17:24       ` Marc Zyngier
  0 siblings, 1 reply; 8+ messages in thread
From: David Brown @ 2012-02-24 17:09 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Stephen Boyd, linux-arm-msm, linux-kernel, linux-arm-kernel

On Fri, Feb 24, 2012 at 10:11:14AM +0000, Marc Zyngier wrote:
> On 22/02/12 21:55, David Brown wrote:
> > On Tue, Feb 21, 2012 at 05:39:37PM -0800, Stephen Boyd wrote:
> >> Now that sched_clock is mandatory on ARM it's simple to add
> >> sched_clock support to the MSM timer code. Add it so that we get
> >> more accurate sched_clock output than the jiffies based version
> >> that's provided by default.
> >>
> >> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> >> Cc: Marc Zyngier <marc.zyngier@arm.com>
> >> Cc: David Brown <davidb@codeaurora.org>
> > 
> > Marc, are you able to pull this into your series, so they can all go
> > in together?  If so:
> > 
> >   Acked-by: David Brown <davidb@codeaurora.org>
> 
> David, Stephen,
> 
> Russell already pulled my sched_clock() patch series, so I'm not sure it
> is actually useful for me to carry it (and there is actually no
> dependency between this patch and the series). Maybe putting it in the
> patch system or via armsoc would be best?
> 
> Otherwise:
> Acked-by: Marc Zyngier <marc.zyngier@arm.com>

I'll keep an eye on it then, and push it into the ARM soc tree when
the dependencies are there.

David

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

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

* Re: [PATCH] msm: timer: Support sched_clock()
  2012-02-24 17:09     ` David Brown
@ 2012-02-24 17:24       ` Marc Zyngier
  2012-02-24 17:32         ` Stephen Boyd
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Zyngier @ 2012-02-24 17:24 UTC (permalink / raw)
  To: David Brown; +Cc: Stephen Boyd, linux-arm-msm, linux-kernel, linux-arm-kernel

On 24/02/12 17:09, David Brown wrote:
> On Fri, Feb 24, 2012 at 10:11:14AM +0000, Marc Zyngier wrote:
>> On 22/02/12 21:55, David Brown wrote:
>>> On Tue, Feb 21, 2012 at 05:39:37PM -0800, Stephen Boyd wrote:
>>>> Now that sched_clock is mandatory on ARM it's simple to add
>>>> sched_clock support to the MSM timer code. Add it so that we get
>>>> more accurate sched_clock output than the jiffies based version
>>>> that's provided by default.
>>>>
>>>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>>>> Cc: Marc Zyngier <marc.zyngier@arm.com>
>>>> Cc: David Brown <davidb@codeaurora.org>
>>>
>>> Marc, are you able to pull this into your series, so they can all go
>>> in together?  If so:
>>>
>>>   Acked-by: David Brown <davidb@codeaurora.org>
>>
>> David, Stephen,
>>
>> Russell already pulled my sched_clock() patch series, so I'm not sure it
>> is actually useful for me to carry it (and there is actually no
>> dependency between this patch and the series). Maybe putting it in the
>> patch system or via armsoc would be best?
>>
>> Otherwise:
>> Acked-by: Marc Zyngier <marc.zyngier@arm.com>
> 
> I'll keep an eye on it then, and push it into the ARM soc tree when
> the dependencies are there.

The whole thing is that there's no dependency. The sched_clock() stuff
has hit mainline during the merge window. This patch could go in right
now, without any harm.

What Russell pulled is just a cleanup to convert the last two platforms
having their own sched_clock() and not relying on our framework.

	M.
-- 
Jazz is not dead. It just smells funny...


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

* Re: [PATCH] msm: timer: Support sched_clock()
  2012-02-24 17:24       ` Marc Zyngier
@ 2012-02-24 17:32         ` Stephen Boyd
  2012-02-24 17:37           ` Marc Zyngier
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Boyd @ 2012-02-24 17:32 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: David Brown, linux-arm-msm, linux-kernel, linux-arm-kernel

Hi Marc,

On 02/24/12 09:24, Marc Zyngier wrote:
> On 24/02/12 17:09, David Brown wrote:
>> I'll keep an eye on it then, and push it into the ARM soc tree when
>> the dependencies are there.
> The whole thing is that there's no dependency. The sched_clock() stuff
> has hit mainline during the merge window. This patch could go in right
> now, without any harm.
>
> What Russell pulled is just a cleanup to convert the last two platforms
> having their own sched_clock() and not relying on our framework.
>
>

This patch relies on the fact that the HAVE_SCHED_CLOCK config option no
longer exists. We could push it in if the patch had that option added to
the Kconfig, but then it would conflict with the removal of the Kconfig
by 6905a65 (ARM: Make the sched_clock framework mandatory, 2012-01-18).

So I guess we send it through the arm-soc tree?

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.


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

* Re: [PATCH] msm: timer: Support sched_clock()
  2012-02-24 17:32         ` Stephen Boyd
@ 2012-02-24 17:37           ` Marc Zyngier
  2012-02-25  1:10             ` David Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Zyngier @ 2012-02-24 17:37 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: David Brown, linux-arm-msm, linux-kernel, linux-arm-kernel

On 24/02/12 17:32, Stephen Boyd wrote:
> Hi Marc,
> 
> On 02/24/12 09:24, Marc Zyngier wrote:
>> On 24/02/12 17:09, David Brown wrote:
>>> I'll keep an eye on it then, and push it into the ARM soc tree when
>>> the dependencies are there.
>> The whole thing is that there's no dependency. The sched_clock() stuff
>> has hit mainline during the merge window. This patch could go in right
>> now, without any harm.
>>
>> What Russell pulled is just a cleanup to convert the last two platforms
>> having their own sched_clock() and not relying on our framework.
>>
>>
> 
> This patch relies on the fact that the HAVE_SCHED_CLOCK config option no
> longer exists. We could push it in if the patch had that option added to
> the Kconfig, but then it would conflict with the removal of the Kconfig
> by 6905a65 (ARM: Make the sched_clock framework mandatory, 2012-01-18).

Ah! Indeed, you're perfectly right.

> So I guess we send it through the arm-soc tree?

I don't think arm-soc tracks rmk/for-next, so this has to go via
Russell's tree. I'll take the patch and send Russell another pull
request then.

Cheers,

	M.
-- 
Jazz is not dead. It just smells funny...


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

* Re: [PATCH] msm: timer: Support sched_clock()
  2012-02-24 17:37           ` Marc Zyngier
@ 2012-02-25  1:10             ` David Brown
  0 siblings, 0 replies; 8+ messages in thread
From: David Brown @ 2012-02-25  1:10 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Stephen Boyd, linux-arm-msm, linux-kernel, linux-arm-kernel

On Fri, Feb 24, 2012 at 05:37:57PM +0000, Marc Zyngier wrote:
> > This patch relies on the fact that the HAVE_SCHED_CLOCK config option no
> > longer exists. We could push it in if the patch had that option added to
> > the Kconfig, but then it would conflict with the removal of the Kconfig
> > by 6905a65 (ARM: Make the sched_clock framework mandatory, 2012-01-18).
> 
> Ah! Indeed, you're perfectly right.
> 
> > So I guess we send it through the arm-soc tree?
> 
> I don't think arm-soc tracks rmk/for-next, so this has to go via
> Russell's tree. I'll take the patch and send Russell another pull
> request then.

Thanks, Marc.

David

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-22  1:39 [PATCH] msm: timer: Support sched_clock() Stephen Boyd
2012-02-22 21:55 ` David Brown
2012-02-24 10:11   ` Marc Zyngier
2012-02-24 17:09     ` David Brown
2012-02-24 17:24       ` Marc Zyngier
2012-02-24 17:32         ` Stephen Boyd
2012-02-24 17:37           ` Marc Zyngier
2012-02-25  1:10             ` David Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).