public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make dyntick work again
@ 2007-10-11 20:32 Tony Lindgren
  2007-10-12  2:05 ` Kyungmin Park
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2007-10-11 20:32 UTC (permalink / raw)
  To: linux-omap-open-source

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

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

[-- Attachment #2: omap-32k-timer-oneshot.patch --]
[-- Type: text/x-diff, Size: 1251 bytes --]

diff --git a/arch/arm/plat-omap/timer32k.c b/arch/arm/plat-omap/timer32k.c
index be7cb8e..1eaec1c 100644
--- a/arch/arm/plat-omap/timer32k.c
+++ b/arch/arm/plat-omap/timer32k.c
@@ -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,
 };
 

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



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

* RE: [PATCH] Make dyntick work again
  2007-10-11 20:32 [PATCH] Make dyntick work again Tony Lindgren
@ 2007-10-12  2:05 ` Kyungmin Park
  2007-10-12 14:47   ` Dirk Behme
  2007-10-12 20:06   ` Tony Lindgren
  0 siblings, 2 replies; 7+ messages in thread
From: Kyungmin Park @ 2007-10-12  2:05 UTC (permalink / raw)
  To: 'Tony Lindgren', linux-omap-open-source

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

> -----Original Message-----
> From: linux-omap-open-source-bounces+kyungmin.park=samsung.com@linux.omap.com [mailto:linux-omap-
> open-source-bounces+kyungmin.park=samsung.com@linux.omap.com] On Behalf Of Tony Lindgren
> Sent: Friday, October 12, 2007 5:33 AM
> To: linux-omap-open-source@linux.omap.com
> 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

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

* Re: [PATCH] Make dyntick work again
  2007-10-12  2:05 ` Kyungmin Park
@ 2007-10-12 14:47   ` Dirk Behme
  2007-10-12 20:07     ` Tony Lindgren
  2007-10-12 20:06   ` Tony Lindgren
  1 sibling, 1 reply; 7+ messages in thread
From: Dirk Behme @ 2007-10-12 14:47 UTC (permalink / raw)
  To: kmpark; +Cc: linux-omap-open-source

Kyungmin Park wrote:
> Umm, there's a problem, I can't boot with timer32k.
> It halts at here.

On OMAP 5912 OSK I get:

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

> 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

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

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

* Re: [PATCH] Make dyntick work again
  2007-10-12  2:05 ` Kyungmin Park
  2007-10-12 14:47   ` Dirk Behme
@ 2007-10-12 20:06   ` Tony Lindgren
  2007-10-12 20:16     ` Woodruff, Richard
  1 sibling, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2007-10-12 20:06 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: linux-omap-open-source

Hi,

* Kyungmin Park <kmpark@infradead.org> [071011 19:07]:
> Hi,
> 
> Umm, there's a problem, I can't boot with timer32k.
> It halts at here.

<snip>

> 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?
 
> 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

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

* Re: [PATCH] Make dyntick work again
  2007-10-12 14:47   ` Dirk Behme
@ 2007-10-12 20:07     ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2007-10-12 20:07 UTC (permalink / raw)
  To: Dirk Behme; +Cc: linux-omap-open-source, kmpark

* Dirk Behme <dirk.behme@googlemail.com> [071012 07:48]:
> Kyungmin Park wrote:
>> Umm, there's a problem, I can't boot with timer32k.
>> It halts at here.
>
> On OMAP 5912 OSK I get:
>
>> <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

Sounds like it's working on omap1 then :)

Tony

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

* RE: [PATCH] Make dyntick work again
  2007-10-12 20:06   ` Tony Lindgren
@ 2007-10-12 20:16     ` Woodruff, Richard
  2007-10-12 20:22       ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Woodruff, Richard @ 2007-10-12 20:16 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap-open-source

Hi,

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

root@128.247.75.244:/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
root@128.247.75.244:/tst# cat /proc/cpuinfo | grep OMAP
Hardware        : OMAP3430 sdp3430 board
root@128.247.75.244:/tst#
--------------------

Regards,
Richard W.

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

* Re: [PATCH] Make dyntick work again
  2007-10-12 20:16     ` Woodruff, Richard
@ 2007-10-12 20:22       ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2007-10-12 20:22 UTC (permalink / raw)
  To: Woodruff, Richard; +Cc: linux-omap-open-source

* Woodruff, Richard <r-woodruff2@ti.com> [071012 13:16]:
> Hi,
> 
> > 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)
> 
> root@128.247.75.244:/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
> root@128.247.75.244:/tst# cat /proc/cpuinfo | grep OMAP
> Hardware        : OMAP3430 sdp3430 board
> root@128.247.75.244:/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

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

end of thread, other threads:[~2007-10-12 20:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-11 20:32 [PATCH] Make dyntick work again Tony Lindgren
2007-10-12  2:05 ` Kyungmin Park
2007-10-12 14:47   ` Dirk Behme
2007-10-12 20:07     ` Tony Lindgren
2007-10-12 20:06   ` Tony Lindgren
2007-10-12 20:16     ` Woodruff, Richard
2007-10-12 20:22       ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox