Skip to contentSkip to conversation

Make dyntick work again

PATCH In review Tony Lindgren 4 participants 7 messages Oct 11, 2007 – Oct 12, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make dyntick work again

Hi all,

Here's a quick patch to make dyntick work on omap again after the clocksource changes. It now uses the Linux common implementation instead of the ARM specific one.

I haven't tested this patch much yet, except:

# grep time /proc/interrupts; sleep 10; grep time /proc/interrupts

Drops the ticks to below 10.

Regards,

Tony

arch/arm/plat-omap/timer32k.c +11 -2
index be7cb8e..1eaec1c 100644
@@ -146,6 +146,14 @@ static inline void omap_32k_timer_ack_irq(void)
 
 #endif
 
+static int omap_32k_timer_set_next_event(unsigned long delta,
+					 struct clock_event_device *dev)
+{
+	omap_32k_timer_start(delta);
+
+	return 0;
+}
+
 static void omap_32k_timer_set_mode(enum clock_event_mode mode,
 				    struct clock_event_device *evt)
 {
@@ -153,9 +161,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
 
 	switch (mode) {
 	case CLOCK_EVT_MODE_PERIODIC:
+	case CLOCK_EVT_MODE_ONESHOT:
 		omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD);
 		break;
-	case CLOCK_EVT_MODE_ONESHOT:
 	case CLOCK_EVT_MODE_UNUSED:
 	case CLOCK_EVT_MODE_SHUTDOWN:
 		break;
@@ -166,8 +174,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
 
 static struct clock_event_device clockevent_32k_timer = {
 	.name		= "32k-timer",
-	.features       = CLOCK_EVT_FEAT_PERIODIC,
+	.features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
 	.shift		= 32,
+	.set_next_event	= omap_32k_timer_set_next_event,
 	.set_mode	= omap_32k_timer_set_mode,
 };
 
#1 lore raw

Hi,

Umm, there's a problem, I can't boot with timer32k. It halts at here.

<5>Linux version 2.6.23-omap1 (kmpark@party) (gcc version 3.4.4 (release) (Code7
CPU: ARMv6-compatible processor [4107b362] revision 2 (ARMv6TEJ), cr=00c5387f
Machine: OMAP24xx Apollon
Memory policy: ECC disabled, Data cache writeback
<7>On node 0 totalpages: 32768

<7>  DMA zone: 256 pages used for memmap
<7>  DMA zone: 0 pages reserved
<7>  DMA zone: 32512 pages, LIFO batch:7
<7>  Normal zone: 0 pages used for memmap
<7>  Movable zone: 0 pages used for memmap

<6>OMAP24204
<6>SRAM: Mapped pa 0x40200000 to va 0xd0000000 size: 0x100000
CPU0: D VIPT write-back cache
CPU0: I cache: 32768 bytes, associativity 4, 32 byte lines, 256 sets
CPU0: D cache: 32768 bytes, associativity 4, 32 byte lines, 256 sets Built 1 zonelists in Zone order. Total pages: 32512
<5>Kernel command line: root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=1922 <6>kernel profiling enabled (shift: 2)
<6>Clocking rate (Crystal/DPLL/MPU): 12.0/660/330 MHz
<6>GPMC revision 2.0
<6>IRQ: Found an INTC at 0xd80fe000 (revision 2.0) with 96 interrupts <6>Total of 96 interrupts on 1 active controller
<6>OMAP242x GPIO hardware version 1.8
PID hash table entries: 512 (order: 9, 2048 bytes)
Console: colour dummy device 80x30
<6>Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) <6>Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) <6>Memory: 128MB = 128MB total
<5>Memory: 124160KB available (2580K code, 303K data, 92K init) <7>Calibrating delay loop... 1.05 BogoMIPS (lpj=4096)
Mount-cache hash table entries: 512
<6>CPU: Testing write buffer coherency:

It's also can't boot 2.6.22, umm I will track this one.

Anyway, I used the mpu timer and here's the dyntick result. (mpu also support the oneshot in the code) Is it the right results?

/ # grep time /proc/interrupts ; sleep 10; grep time /proc/interrupts

 37:        714        INTC  gp timer
 37:        787        INTC  gp timer
/ # grep time /proc/interrupts ; sleep 10; grep time /proc/interrupts
 37:        880        INTC  gp timer
 37:        959        INTC  gp timer

Thank you,
Kyungmin Park

P.S., here's the current kernel configuration (timer 32k) CONFIG_GENERIC_TIME=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_OMAP_32K_TIMER=y CONFIG_OMAP_32K_TIMER_HZ=128 CONFIG_OMAP_DM_TIMER=y
# Kernel Features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT=y
CONFIG_HZ=128

Quoted 22 lines

-----Original Message-----
From: linux-omap-open-source-bounces+kyungmin.park=samsung.com@linux.omap.com [mailto:linux-omap- [email protected]] On Behalf Of Tony Lindgren
Sent: Friday, October 12, 2007 5:33 AM
To: [email protected]
Subject: [PATCH] Make dyntick work again

Hi all,

Here's a quick patch to make dyntick work on omap again after the clocksource changes. It now uses the Linux common implementation instead of the ARM specific one.

I haven't tested this patch much yet, except:

# grep time /proc/interrupts; sleep 10; grep time /proc/interrupts

Drops the ticks to below 10.

Regards,

Tony

#2 lore raw
Quoted 2 lines · Kyungmin Park

Umm, there's a problem, I can't boot with timer32k. It halts at here.

On OMAP 5912 OSK I get:

Quoted 3 lines

<7>Calibrating delay loop... 1.05 BogoMIPS (lpj=4096) Mount-cache hash table entries: 512
<6>CPU: Testing write buffer coherency:

...
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
MUX: initialized M19_1610_CAM_RSTZ
...
MUX: initialized PWL
OMAP DMA hardware version 1
DMA capabilities: 000c0000:00000000:01ff:003f:007f Initializing OMAP McBSP system omap_dsp_init() done
USB: hmc 16, usb2 alt 0 wires
i2c_omap i2c_omap.1: bus 1 rev2.2 at 100 kHz
tps65010: version 2 May 2005
Time: 32k_counter clocksource has been installed. Switched to high resolution mode on CPU 0
NET: Registered protocol family 2
...

Quoted 5 lines

P.S., here's the current kernel configuration (timer 32k) CONFIG_GENERIC_TIME=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_OMAP_32K_TIMER=y CONFIG_OMAP_32K_TIMER_HZ=128

Quoted 8 lines

CONFIG_OMAP_DM_TIMER=y
# Kernel Features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT=y
CONFIG_HZ=128

my config:

CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CLOCKEVENTS=y
# CONFIG_OMAP_MPU_TIMER is not set
CONFIG_OMAP_32K_TIMER=y
CONFIG_OMAP_32K_TIMER_HZ=128
# CONFIG_OMAP_DM_TIMER is not set

#
# Kernel Features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT=y
CONFIG_HZ=128

As the "ok" in "CPU: Testing write buffer coherency: ok" is already missing in your output, maybe it is anything else?

Regards

Dirk

#3 lore raw
Quoted 19 lines · Dirk Behme
Quoted 2 lines · Kyungmin Park

Umm, there's a problem, I can't boot with timer32k. It halts at here.

On OMAP 5912 OSK I get:

Quoted 3 lines

<7>Calibrating delay loop... 1.05 BogoMIPS (lpj=4096) Mount-cache hash table entries: 512
<6>CPU: Testing write buffer coherency:

...
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
MUX: initialized M19_1610_CAM_RSTZ
...
MUX: initialized PWL
OMAP DMA hardware version 1
DMA capabilities: 000c0000:00000000:01ff:003f:007f

Quoted 8 lines

Initializing OMAP McBSP system
omap_dsp_init() done
USB: hmc 16, usb2 alt 0 wires
i2c_omap i2c_omap.1: bus 1 rev2.2 at 100 kHz
tps65010: version 2 May 2005
Time: 32k_counter clocksource has been installed.
Switched to high resolution mode on CPU 0
NET: Registered protocol family 2

Sounds like it's working on omap1 then :)

Tony

#4 lore raw
In reply to Kyungmin Park

Hi,

Quoted 4 lines · Kyungmin Park

Hi,

Umm, there's a problem, I can't boot with timer32k. It halts at here.

<snip>

Quoted 1 line

It's also can't boot 2.6.22, umm I will track this one.

Hmm, works on n800 which is 2420. Maybe it's some 2430 related issue?

Quoted 9 lines

Anyway, I used the mpu timer and here's the dyntick result. (mpu also support the oneshot in the code) Is it the right results?

/ # grep time /proc/interrupts ; sleep 10; grep time /proc/interrupts

 37:        714        INTC  gp timer
 37:        787        INTC  gp timer
/ # grep time /proc/interrupts ; sleep 10; grep time /proc/interrupts
 37:        880        INTC  gp timer
 37:        959        INTC  gp timer

Yes, (959 - 880) / 10 = 7 ticks per second. We should be able to get down to ~2 ticks per second with an idle system already, so sounds like there are some kernel timers running.

Time to try powertop on omap!

Tony

#5 lore raw

Hi,

Quoted 1 line

Time to try powertop on omap!

Here is powertop running on 3430 using dynamic tick :) It would be nice to format the C state information such that it reports residency. Sometime in the future. It is directly useable for seeing timers. Not so many timers running on a full up NFS mounted system. It used to run fine on OMAP2 from GIT once clocksource came.

--------------------
< Detailed C-state information is only available on Mobile CPUs (laptops) >

Wakeups-from-idle per second : 13.1 interval: 10.0s

Top causes for wakeups:

  38.9% (  4.2)       <interrupt> : 32KHz timer
  29.6% (  3.2)       <interrupt> : eth0
   9.3% (  1.0)     <kernel core> : __netdev_watchdog_up (dev_watchdog)
   4.6% (  0.5)     <kernel core> : queue_delayed_work_on (delayed_work_timer_fn
   2.8% (  0.3)     <kernel core> : irlmp_start_discovery_timer (irlmp_discovery

_timer_expired)

[email protected]:/tst# uname -a
Linux 128.247.75.244 2.6.22.1-omap1 #3 Fri Oct 12 14:53:45 CDT 2007 armv7l GNU/L
inux
[email protected]:/tst# cat /proc/cpuinfo | grep OMAP
Hardware        : OMAP3430 sdp3430 board
[email protected]:/tst#
--------------------

Regards,
Richard W.

#6 lore raw
Quoted 20 lines · Woodruff, Richard

Hi,

Quoted 1 line

Time to try powertop on omap!

Here is powertop running on 3430 using dynamic tick :) It would be nice to format the C state information such that it reports residency. Sometime in the future. It is directly useable for seeing timers. Not so many timers running on a full up NFS mounted system. It used to run fine on OMAP2 from GIT once clocksource came.

--------------------
< Detailed C-state information is only available on Mobile CPUs (laptops) >

Wakeups-from-idle per second : 13.1 interval: 10.0s

Top causes for wakeups:

  38.9% (  4.2)       <interrupt> : 32KHz timer
  29.6% (  3.2)       <interrupt> : eth0
   9.3% (  1.0)     <kernel core> : __netdev_watchdog_up (dev_watchdog)
   4.6% (  0.5)     <kernel core> : queue_delayed_work_on (delayed_work_timer_fn
   2.8% (  0.3)     <kernel core> : irlmp_start_discovery_timer (irlmp_discovery

_timer_expired)

Quoted 7 lines
[email protected]:/tst# uname -a
Linux 128.247.75.244 2.6.22.1-omap1 #3 Fri Oct 12 14:53:45 CDT 2007 armv7l GNU/L
inux
[email protected]:/tst# cat /proc/cpuinfo | grep OMAP
Hardware        : OMAP3430 sdp3430 board
[email protected]:/tst#
--------------------

Great! Time to push that patch then. I also run a quick timer tests with select and sleep, and they're working just fine.

Tony