linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 4/4] iop: implement sched_clock()
@ 2009-09-26 19:52 Mikael Pettersson
  2009-09-29  7:08 ` Aaro Koskinen
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2009-09-26 19:52 UTC (permalink / raw)
  To: linux-arm-kernel

This adds a better sched_clock() to the IOP platform,
implemented using its new clocksource support.

Tested on n2100, compile-tested for all plat-iop machines.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
---
Changes v1 -> v2:
* implemented sched_clock()

 arch/arm/plat-iop/time.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff -rupN linux-2.6.31.arm-iop-3-generictime-v2/arch/arm/plat-iop/time.c linux-2.6.31.arm-iop-4-sched_clock/arch/arm/plat-iop/time.c
--- linux-2.6.31.arm-iop-3-generictime-v2/arch/arm/plat-iop/time.c	2009-09-26 17:25:09.000000000 +0200
+++ linux-2.6.31.arm-iop-4-sched_clock/arch/arm/plat-iop/time.c	2009-09-26 17:24:29.000000000 +0200
@@ -66,6 +66,14 @@ static void __init iop_clocksource_set_h
 }
 
 /*
+ * IOP sched_clock() implementation via its clocksource.
+ */
+unsigned long long sched_clock(void)
+{
+	return cyc2ns(&iop_clocksource, iop_clocksource_read(NULL));
+}
+
+/*
  * IOP clockevents (interrupting timer 0).
  */
 static int iop_set_next_event(unsigned long delta,

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

* [PATCH v2 4/4] iop: implement sched_clock()
  2009-09-26 19:52 [PATCH v2 4/4] iop: implement sched_clock() Mikael Pettersson
@ 2009-09-29  7:08 ` Aaro Koskinen
  0 siblings, 0 replies; 2+ messages in thread
From: Aaro Koskinen @ 2009-09-29  7:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

Mikael Pettersson wrote:
> This adds a better sched_clock() to the IOP platform,
> implemented using its new clocksource support.
> 
> Tested on n2100, compile-tested for all plat-iop machines.
> 
> Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
> ---
> Changes v1 -> v2:
> * implemented sched_clock()
> 
>  arch/arm/plat-iop/time.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff -rupN linux-2.6.31.arm-iop-3-generictime-v2/arch/arm/plat-iop/time.c linux-2.6.31.arm-iop-4-sched_clock/arch/arm/plat-iop/time.c
> --- linux-2.6.31.arm-iop-3-generictime-v2/arch/arm/plat-iop/time.c	2009-09-26 17:25:09.000000000 +0200
> +++ linux-2.6.31.arm-iop-4-sched_clock/arch/arm/plat-iop/time.c	2009-09-26 17:24:29.000000000 +0200
> @@ -66,6 +66,14 @@ static void __init iop_clocksource_set_h
>  }
>  
>  /*
> + * IOP sched_clock() implementation via its clocksource.
> + */
> +unsigned long long sched_clock(void)
> +{
> +	return cyc2ns(&iop_clocksource, iop_clocksource_read(NULL));
> +}
> +
> +/*

This may not work properly on 2.6.31 because the multiplier may be adjusted. If you want
to run these patches on top of 2.6.31, check the OMAP sched_clock() which uses mult_orig,
or maybe drop this patch.

You could also rebase onto current mainline, and use clocksource_cyc2ns().

See commits 80ea3bac3a47bc73efa334d0dd57099d0ff14216 and
0a54419836254a27baecd9037103171bcbabaf67 for more info.

A.

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

end of thread, other threads:[~2009-09-29  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-26 19:52 [PATCH v2 4/4] iop: implement sched_clock() Mikael Pettersson
2009-09-29  7:08 ` Aaro Koskinen

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