From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] omap1: Fix sched_clock for the MPU timer (Re: State of LDP3430 platform)
Date: Tue, 18 Jan 2011 14:26:13 -0800 [thread overview]
Message-ID: <20110118222613.GS4957@atomide.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1101181234130.13225@utopia.booyaka.com>
* Paul Walmsley <paul@pwsan.com> [110118 11:35]:
>
> Here's a slightly updated version of this patch, fixing a bug in one of
> the comments, and revising the commit message. There's no functional
> difference between this and the previous version of this patch.
Thanks, here are two patches to fix the MPU timer, and then allow
compiling in both the MPU timer and the 32KiHz timer.
Tony
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 18 Jan 2011 13:25:39 -0800
Subject: [PATCH] omap1: Fix sched_clock for the MPU timer
Otherwise systems using the MPU timer will hang.
Signed-off-by: Tony Lindgren <tony@atomide.com>
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -44,11 +44,14 @@
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <linux/io.h>
+#include <linux/sched.h>
#include <asm/system.h>
#include <mach/hardware.h>
#include <asm/leds.h>
#include <asm/irq.h>
+#include <asm/sched_clock.h>
+
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
@@ -67,7 +70,7 @@ typedef struct {
((volatile omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \
(n)*OMAP_MPU_TIMER_OFFSET))
-static inline unsigned long omap_mpu_timer_read(int nr)
+static inline unsigned long notrace omap_mpu_timer_read(int nr)
{
volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
return timer->read_tim;
@@ -212,11 +215,21 @@ static struct clocksource clocksource_mpu = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
+static DEFINE_CLOCK_DATA(cd);
+
+static void notrace mpu_update_sched_clock(void)
+{
+ u32 cyc = mpu_read(&clocksource_mpu);
+ update_sched_clock(&cd, cyc, (u32)~0);
+}
+
static void __init omap_init_clocksource(unsigned long rate)
{
static char err[] __initdata = KERN_ERR
"%s: can't register clocksource!\n";
+ init_sched_clock(&cd, mpu_update_sched_clock, 32, rate);
+
setup_irq(INT_TIMER2, &omap_mpu_timer2_irq);
omap_mpu_timer_start(1, ~0, 1);
next prev parent reply other threads:[~2011-01-18 22:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20101206125526.GC31777@n2100.arm.linux.org.uk>
[not found] ` <20101206181913.GH8345@atomide.com>
[not found] ` <alpine.DEB.2.00.1012061125400.13430@utopia.booyaka.com>
[not found] ` <20101207083720.GB18336@n2100.arm.linux.org.uk>
[not found] ` <alpine.DEB.2.00.1012071745120.13430@utopia.booyaka.com>
[not found] ` <alpine.DEB.2.00.1012072012000.13430@utopia.booyaka.com>
[not found] ` <20110115000301.GT4957@atomide.com>
[not found] ` <alpine.DEB.2.00.1101151237240.32245@utopia.booyaka.com>
[not found] ` <20110115233744.GA18159@n2100.arm.linux.org.uk>
2011-01-16 4:32 ` State of LDP3430 platform Paul Walmsley
2011-01-16 15:08 ` Thomas Weber
2011-01-18 19:36 ` Paul Walmsley
2011-01-18 22:26 ` Tony Lindgren [this message]
2011-01-18 22:35 ` [PATCH] omap1: Fix booting for 15xx and 730 with omap1_defconfig (Re: State of LDP3430 platform) Tony Lindgren
2011-01-18 23:21 ` Tony Lindgren
2011-01-19 18:43 ` [PATCH] omap1: Fix sched_clock implementation when both MPU timer and 32K timer are used " Tony Lindgren
2011-01-19 18:44 ` [PATCH] omap1: Fix sched_clock for the MPU timer " Tony Lindgren
2011-01-19 13:43 ` State of LDP3430 platform Jarkko Nikula
2011-01-18 1:25 ` Tony Lindgren
2011-01-18 19:24 ` Paul Walmsley
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=20110118222613.GS4957@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 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).