linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: tegra: timer: Separate clocksource and sched_clock
@ 2010-11-18  0:20 Colin Cross
  2010-11-18  0:27 ` john stultz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Colin Cross @ 2010-11-18  0:20 UTC (permalink / raw)
  To: linux-arm-kernel

tegra_clocksource_read should not use cnt32_to_63, wrapping is
already handled in the clocksource code.  Move the cnt32_to_63
into the sched_clock function, and replace the use of clocksource
mult and shift with a multiplication by 1000 to convert us to ns.

Change-Id: Ica1158c3fbed0ba53391f7db61180129a957511d
Signed-off-by: Colin Cross <ccross@android.com>
---
 arch/arm/mach-tegra/timer.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index 9057d6f..b49f2f5 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -91,7 +91,7 @@ static void tegra_timer_set_mode(enum clock_event_mode mode,
 
 static cycle_t tegra_clocksource_read(struct clocksource *cs)
 {
-	return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US));
+	return timer_readl(TIMERUS_CNTR_1US);
 }
 
 static struct clock_event_device tegra_clockevent = {
@@ -106,14 +106,13 @@ static struct clocksource tegra_clocksource = {
 	.name	= "timer_us",
 	.rating	= 300,
 	.read	= tegra_clocksource_read,
-	.mask	= 0x7FFFFFFFFFFFFFFFULL,
+	.mask	= CLOCKSOURCE_MASK(32),
 	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
 unsigned long long sched_clock(void)
 {
-	return clocksource_cyc2ns(tegra_clocksource.read(&tegra_clocksource),
-		tegra_clocksource.mult, tegra_clocksource.shift);
+	return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US)) * 1000;
 }
 
 static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id)
-- 
1.7.3.1

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

* [PATCH] ARM: tegra: timer: Separate clocksource and sched_clock
  2010-11-18  0:20 [PATCH] ARM: tegra: timer: Separate clocksource and sched_clock Colin Cross
@ 2010-11-18  0:27 ` john stultz
  2010-11-19 19:08 ` Linus Walleij
  2010-12-13 13:51 ` Russell King - ARM Linux
  2 siblings, 0 replies; 5+ messages in thread
From: john stultz @ 2010-11-18  0:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2010-11-17 at 16:20 -0800, Colin Cross wrote:
> tegra_clocksource_read should not use cnt32_to_63, wrapping is
> already handled in the clocksource code.  Move the cnt32_to_63
> into the sched_clock function, and replace the use of clocksource
> mult and shift with a multiplication by 1000 to convert us to ns.
> 
> Change-Id: Ica1158c3fbed0ba53391f7db61180129a957511d
> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: John Stultz <johnstul@us.ibm.com>

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

* [PATCH] ARM: tegra: timer: Separate clocksource and sched_clock
  2010-11-18  0:20 [PATCH] ARM: tegra: timer: Separate clocksource and sched_clock Colin Cross
  2010-11-18  0:27 ` john stultz
@ 2010-11-19 19:08 ` Linus Walleij
  2010-12-13 13:51 ` Russell King - ARM Linux
  2 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2010-11-19 19:08 UTC (permalink / raw)
  To: linux-arm-kernel

2010/11/18 Colin Cross <ccross@android.com>:

> tegra_clocksource_read should not use cnt32_to_63, wrapping is
> already handled in the clocksource code. ?Move the cnt32_to_63
> into the sched_clock function, and replace the use of clocksource
> mult and shift with a multiplication by 1000 to convert us to ns.
>
> Change-Id: Ica1158c3fbed0ba53391f7db61180129a957511d

The Linux kernel does not use Gerrit...

> Signed-off-by: Colin Cross <ccross@android.com>

Apart from that:
Acked-by: Linus Walleij <linus.walleij@stericsson.com>

Yours,
Linus Walleij

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

* [PATCH] ARM: tegra: timer: Separate clocksource and sched_clock
  2010-11-18  0:20 [PATCH] ARM: tegra: timer: Separate clocksource and sched_clock Colin Cross
  2010-11-18  0:27 ` john stultz
  2010-11-19 19:08 ` Linus Walleij
@ 2010-12-13 13:51 ` Russell King - ARM Linux
  2010-12-13 22:55   ` Colin Cross
  2 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2010-12-13 13:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 17, 2010 at 04:20:15PM -0800, Colin Cross wrote:
> tegra_clocksource_read should not use cnt32_to_63, wrapping is
> already handled in the clocksource code.  Move the cnt32_to_63
> into the sched_clock function, and replace the use of clocksource
> mult and shift with a multiplication by 1000 to convert us to ns.

Colin,

Mind if I pick this up into my tree - I'm doing other work with
clocksources and sched_clock() at the moment which will clash with
this patch.

Thanks.

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

* [PATCH] ARM: tegra: timer: Separate clocksource and sched_clock
  2010-12-13 13:51 ` Russell King - ARM Linux
@ 2010-12-13 22:55   ` Colin Cross
  0 siblings, 0 replies; 5+ messages in thread
From: Colin Cross @ 2010-12-13 22:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 13, 2010 at 5:51 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Wed, Nov 17, 2010 at 04:20:15PM -0800, Colin Cross wrote:
>> tegra_clocksource_read should not use cnt32_to_63, wrapping is
>> already handled in the clocksource code. ?Move the cnt32_to_63
>> into the sched_clock function, and replace the use of clocksource
>> mult and shift with a multiplication by 1000 to convert us to ns.
>
> Colin,
>
> Mind if I pick this up into my tree - I'm doing other work with
> clocksources and sched_clock() at the moment which will clash with
> this patch.

Sure, I'll need to coordinate the Tegra tree with your tree already
because of the GIC and SMP changes.

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

end of thread, other threads:[~2010-12-13 22:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18  0:20 [PATCH] ARM: tegra: timer: Separate clocksource and sched_clock Colin Cross
2010-11-18  0:27 ` john stultz
2010-11-19 19:08 ` Linus Walleij
2010-12-13 13:51 ` Russell King - ARM Linux
2010-12-13 22:55   ` Colin Cross

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).