Skip to contentSkip to conversation

Send OMAP clocksource and clockevent to rt mailing list

RFC In review Dirk Behme 4 participants 8 messages Dec 19, 2006 – Dec 21, 2006

Subsystems (3)
lore
Share & tools
lore

Dirk Behme

author
#0 lore raw

RFC 1/1 Send OMAP clocksource and clockevent to rt mailing list

Hi,

recently, there were some ARM related clocksource and clockevent patches sent to the rt mailing list [1]. Looks like they didn't get too many objections :) So, I'd like to send our clocksource and clockevent patches to that list as well.

I took (in this order)

linux-2.6.19.tar.bz2 (clean Linus one, not our OMAP tree) patch-2.6.19-rt15 [2] patch-2.6.19-rt15-fixes.diff [3]

and then our patches

arm-hrt-kconfig-patch.txt
arm-no-hz-patch.txt
arm_omap_clocksource_patch.txt
arm_omap_clockevents_patch.txt

(from Daniel, Kevin, David and me) and updated them to apply cleanly to Linus kernel + rt patch. Kernel built with these patches applied boots at least on OSK. For reference, see patches in attachment.

Any objections to send these patches in attachment to rt mailing list?

Dirk

[1]
http://permalink.gmane.org/gmane.linux.rt.user/72
http://permalink.gmane.org/gmane.linux.rt.user/78

Umph, the archive looks broken. Best archive I get with

http://rss.gmane.org/gmane.linux.rt.user

Sender names and dates seem to be wrong there anyway.

[2] http://people.redhat.com/mingo/realtime-preempt/

[3] http://permalink.gmane.org/gmane.linux.rt.user/69

Subject: ARM: Kconfig support for GENERIC_CLOCKEVENTS

arch/arm/Kconfig +6 -0
Index: linux-2.6.19/arch/arm/Kconfig
===================================================================
@@ -21,6 +21,10 @@ config GENERIC_TIME
 	bool
 	default n
 
+config GENERIC_CLOCKEVENTS
+	bool
+	default n
+
 config MMU
 	bool
 	default y
@@ -443,6 +447,8 @@ endmenu
 
 menu "Kernel Features"
 
+source "kernel/time/Kconfig"
+
 config SMP
 	bool "Symmetric Multi-Processing (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && REALVIEW_MPCORE

Subject: ARM: NO_HZ support

arch/arm/Kconfig +1 -0
Index: linux-2.6.19/arch/arm/Kconfig
===================================================================
@@ -497,6 +497,7 @@ source kernel/Kconfig.preempt
 
 config NO_IDLE_HZ
 	bool "Dynamic tick timer"
+	depends on !GENERIC_CLOCKEVENTS
 	help
 	  Select this option if you want to disable continuous timer ticks
 	  and have them programmed to occur as required. This option saves

Add clocksource driver for OMAP.

This is an update of

http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=3876/1

from Daniel Walker and Kevin Hilman.

Changes from Dirk Behme:

- Apply cleanly to recent git (pt_regs change)
- Move clocksource init to extra function. Can be called later by clocksource subsystem
- Remove warning: 'omap_32k_timer_handler' defined but not used when CONFIG_NO_IDLE_HZ isn't set.
- Minor cleanups

Changes from David Brownell:

- OMAP1, OMAP2: 32k clocksource is always available on 16xx and 24xx
- OMAP1 MPU timer:
* consult clock framework to determine xtal clock
* bugfix sched_clock() low order bits
* cleanup
- Kconfig updates

Note that "MPU timer" still doesn't have lost tick support.

arch/arm/Kconfig +1 -0
Index: linux-2.6.19/arch/arm/Kconfig
===================================================================
@@ -318,6 +318,7 @@ config ARCH_LH7A40X
 
 config ARCH_OMAP
 	bool "TI OMAP"
+	select GENERIC_TIME
 	help
 	  Support for TI's OMAP platform (OMAP1 and OMAP2).
 
arch/arm/plat-omap/common.c +50 -0

53 lines not on this page · raw message

arch/arm/plat-omap/timer32k.c +18 -16
Index: linux-2.6.19/arch/arm/plat-omap/timer32k.c
===================================================================
@@ -42,6 +42,7 @@
 #include <linux/spinlock.h>
 #include <linux/err.h>
 #include <linux/clk.h>
+#include <linux/clocksource.h>
 
 #include <asm/system.h>
 #include <asm/hardware.h>
@@ -171,15 +172,6 @@ omap_32k_ticks_to_nsecs(unsigned long ti
 static unsigned long omap_32k_last_tick = 0;
 
 /*
- * Returns elapsed usecs since last 32k timer interrupt
- */
-static unsigned long omap_32k_timer_gettimeoffset(void)
-{
-	unsigned long now = omap_32k_sync_timer_read();
-	return omap_32k_ticks_to_usecs(now - omap_32k_last_tick);
-}
-
-/*
  * 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.
  */
@@ -217,11 +209,6 @@ static inline irqreturn_t _omap_32k_time
 	return IRQ_HANDLED;
 }
 
-static irqreturn_t omap_32k_timer_handler(int irq, void *dev_id)
-{
-	return _omap_32k_timer_interrupt(irq, dev_id);
-}
-
 static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id)
 {
 	unsigned long flags;
@@ -234,6 +221,7 @@ static irqreturn_t omap_32k_timer_interr
 }
 
 #ifdef CONFIG_NO_IDLE_HZ
+
 /*
  * Programs the next timer interrupt needed. Called when dynamic tick is
  * enabled, and to reprogram the ticks to skip from pm_idle. Note that
@@ -269,6 +257,22 @@ static int omap_32k_timer_disable_dyn_ti
 	return 0;
 }
 
+static irqreturn_t omap_32k_timer_handler(int irq, void *dev_id)
+{
+	unsigned long now;
+
+	now = omap_32k_sync_timer_read();
+
+	/* Don't bother reprogramming timer if last tick was before next
+	 * jiffie. We will get another interrupt when previously programmed
+	 * timer expires. This cuts down interrupt load quite a bit.
+	 */
+	if (now - omap_32k_last_tick < OMAP_32K_TICKS_PER_HZ)
+		return IRQ_HANDLED;
+
+	return _omap_32k_timer_interrupt(irq, dev_id);
+}
+
 static struct dyn_tick_timer omap_dyn_tick_timer = {
 	.enable		= omap_32k_timer_enable_dyn_tick,
 	.disable	= omap_32k_timer_disable_dyn_tick,
@@ -291,7 +295,6 @@ static __init void omap_init_32k_timer(v
 
 	if (cpu_class_is_omap1())
 		setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
-	omap_timer.offset  = omap_32k_timer_gettimeoffset;
 	omap_32k_last_tick = omap_32k_sync_timer_read();
 
 #ifdef CONFIG_ARCH_OMAP2
@@ -326,5 +329,4 @@ static void __init omap_timer_init(void)
 
 struct sys_timer omap_timer = {
 	.init		= omap_timer_init,
-	.offset		= NULL,		/* Initialized later */
 };
arch/arm/mach-omap1/time.c +71 -71

208 lines not on this page · raw message

arch/arm/mach-omap1/time.c +64 -8

113 lines not on this page · raw message

arch/arm/plat-omap/Kconfig +2 -0
Index: linux-2.6.19/arch/arm/plat-omap/Kconfig
===================================================================
@@ -11,6 +11,8 @@ choice
 
 config ARCH_OMAP1
 	bool "TI OMAP1"
+ 	select GENERIC_TIME
+	select GENERIC_CLOCKEVENTS
 
 config ARCH_OMAP2
 	bool "TI OMAP2"
arch/arm/plat-omap/timer32k.c +58 -100

206 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Dirk Behme

Any objections to send these patches in attachment to rt mailing list?

It's fine with me.

Daniel

#2 lore raw
In reply to Dirk Behme
Quoted 2 lines · Dirk Behme

Any objections to send these patches in attachment to rt mailing list?

No objections here.

Tony, I was going to submit the clocksoure/clockevent to RMK, but since we missed the merge window, can we just add the clocksource/clockevent patches to the patch queue that's already going to RMK? Or would you rather I do it separately?

Kevin

author
#3 lore raw
Quoted 3 lines · Kevin Hilman

Tony, I was going to submit the clocksoure/clockevent to RMK, but since we missed the merge window, can we just add the clocksource/clockevent patches to the patch queue that's already going to RMK?

Clocksource yes, I have it in my pending patches list. But clockevent still needs CONFIG_PREEMPT_RT patch? So this can't directly go to RMK?

I now sent our clocksource/clockevent patches to -rt mailing list [1]. If clocksource goes to RMK as well, we have two paths we can get it into mainline. Let us see which is the faster and better one. The biggest risk will be some merge conflicts if both are successful ;)

Dirk

[1] http://news.gmane.org/gmane.linux.rt.user
(works now)

#4 lore raw
Quoted 8 lines · Dirk Behme
Quoted 3 lines · Kevin Hilman

Tony, I was going to submit the clocksoure/clockevent to RMK, but since we missed the merge window, can we just add the clocksource/clockevent patches to the patch queue that's already going to RMK?

Clocksource yes, I have it in my pending patches list. But clockevent still needs CONFIG_PREEMPT_RT patch? So this can't directly go to RMK?

Yes, I'll be updating the patch queue. So I guess the plan is to send clocksource through RMK. But that will take a while before that gets merged.

Quoted 5 lines

I now sent our clocksource/clockevent patches to -rt mailing list [1]. If clocksource goes to RMK as well, we have two paths we can get it into mainline. Let us see which is the faster and better one. The biggest risk will be some merge conflicts if both are successful ;)

No problem with merge conclicts on the RMK queue, I can easily refresh that patch series accordingly. So let's send what is needed to be included in the RT series.

Regards,

Tony

Quoted 4 lines

[1] http://news.gmane.org/gmane.linux.rt.user
(works now)

author
#5 lore raw
Quoted 6 lines · [email protected] wrote:
Quoted 1 line · Dirk Behme

I now sent our clocksource/clockevent patches to -rt mailing list [1]. If clocksource goes to RMK as well, we have two paths we can get it into mainline. Let us see which is the faster and better one. The biggest risk will be some merge conflicts if both are successful ;)

No problem with merge conclicts on the RMK queue, I can easily refresh that patch series accordingly. So let's send what is needed to be included in the RT series.

I think at least our latest clocksource [1] patch should go to RMK.

Kevin: What's about clockevent and RMK?

Btw, I got some feedback not to send the clocksource/clockevent patches to -rt mailing list. Instead LKML should be used. I will see to find some time to send it to LKML as well.

Dirk

[1] http://linux.omap.com/pipermail/linux-omap-open-source/2006-December/008569.html

#6 lore raw
Quoted 8 lines · Dirk Behme
Quoted 7 lines · [email protected] wrote:
Quoted 5 lines · Dirk Behme

I now sent our clocksource/clockevent patches to -rt mailing list [1]. If clocksource goes to RMK as well, we have two paths we can get it into mainline. Let us see which is the faster and better one. The biggest risk will be some merge conflicts if both are successful ;)

Quoted 8 lines
Quoted 3 lines

No problem with merge conclicts on the RMK queue, I can easily refresh that patch series accordingly. So let's send what is needed to be included in the RT series.

I think at least our latest clocksource [1] patch should go to RMK.

Kevin: What's about clockevent and RMK?

Sorry for the confusion. Only clocksource patches are going to RMK for now since the clockevents are dependent on tglx's -hrt-dyntick patch (part of -rt)

Kevin

reviewer
#7 lore raw
Quoted 13 lines · Kevin Hilman
Quoted 12 lines · Dirk Behme
Quoted 10 lines · [email protected] wrote:
Quoted 5 lines · Dirk Behme

I now sent our clocksource/clockevent patches to -rt mailing list [1]. If clocksource goes to RMK as well, we have two paths we can get it into mainline. Let us see which is the faster and better one. The biggest risk will be some merge conflicts if both are successful ;)

No problem with merge conclicts on the RMK queue, I can easily refresh that patch series accordingly. So let's send what is needed to be included in the RT series.

Quoted 8 lines
Quoted 4 lines

I think at least our latest clocksource [1] patch should go to RMK.

Kevin: What's about clockevent and RMK?

Sorry for the confusion. Only clocksource patches are going to RMK for now since the clockevents are dependent on tglx's -hrt-dyntick patch (part of -rt)

Sounds good to me.

Tony