All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Bird <tim.bird@am.sony.com>
To: linux kernel <linux-kernel@vger.kernel.org>
Cc: Kevin Hilman <khilman@deeprootsystems.com>,
	linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>,
	linux-omap-open-source@linux.omap.com
Subject: [PATCH] omap: add sched_clock for omap1 based on MPU timer
Date: Fri, 22 May 2009 12:47:24 -0700	[thread overview]
Message-ID: <4A17014C.7080305@am.sony.com> (raw)

Define a higher-resolution sched_clock for OMAP
using the MPU timer, when it is configured on.

This produces better results from ftrace.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
---
 arch/arm/mach-omap1/time.c  |    9 +++++++++
 arch/arm/plat-omap/common.c |    2 ++
 2 files changed, 11 insertions(+)

--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -212,6 +212,15 @@ static struct clocksource clocksource_mp
 	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
 };

+unsigned long long notrace sched_clock(void)
+{
+	unsigned long long ret;
+
+	ret = (unsigned long long) ~omap_mpu_timer_read(1);
+	ret = (ret * clocksource_mpu.mult_orig) >> clocksource_mpu.shift;
+	return ret;
+}
+
 static void __init omap_init_clocksource(unsigned long rate)
 {
 	static char err[] __initdata = KERN_ERR
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -199,6 +199,7 @@ static struct clocksource clocksource_32
 	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
 };

+#ifndef CONFIG_OMAP_MPU_TIMER
 /*
  * Returns current time from boot in nsecs. It's OK for this to wrap
  * around for now, as it's just a relative time stamp.
@@ -211,6 +212,7 @@ unsigned long long notrace sched_clock(v
 	ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift;
 	return ret;
 }
+#endif

 static int __init omap_init_clocksource_32k(void)
 {


             reply	other threads:[~2009-05-22 19:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-22 19:47 Tim Bird [this message]
2009-05-22 20:41 ` [PATCH] omap: add sched_clock for omap1 based on MPU timer Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A17014C.7080305@am.sony.com \
    --to=tim.bird@am.sony.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap-open-source@linux.omap.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.