From: Amit C. <Ami...@mi...> - 2005-03-17 09:22:38
|
Hi Todd, The sched_clock fucntion returns time in nanoseconds. It is defined for = both 32K timer and MPU timer. Please let me know whether the the bitwise = negation should be removed because I didn't see any "0 - omap_mpu_timer_read(0)". If we want the resolution in microseconds or milliseconds, we can = multiply the value returned by sched_clock(). Please let me know. From arch/arm/kernel/time.c unsigned long long __attribute__((weak)) sched_clock(void) { return (unsigned long long)jiffies * (1000000000 / HZ); } Regards, Amit -----Original Message----- From: Todd Poynor [mailto:tp...@mv...] Sent: Thursday, March 17, 2005 8:52 AM To: Amit Choudhary Cc: dyn...@li... Subject: Re: patch for omap for dpm-2.6.11 (change read_mputimer1() to sched_clock()) Amit Choudhary wrote: > If I have not missed something then the call to read_mputimer1() = should be > modified to sched_clock(). > I am attaching a patch to change the definition of dpm_md_time() > [include/asm-arm/arch-omap/dpm.h] to take care of that. Hello Amit -- Sounds right; the copy of MPU timer1 reading code into DPM = was a temporary mod while sched_clock was jiffie-based instead of a=20 microsecond-level timer in the OMAP tree (if I remember correctly). Now = that it's (normally) based on MPU timer 1 we should be able to kill most = or all of the code for that in the DPM patch (the definitions of MPU=20 timer register addresses and bits, etc.). It's slightly more complicated than I've been able to keep up with=20 recently, for example, use of MPU timer 1 is dependent on=20 CONFIG_OMAP_MPU_TIMER, and there's also CONFIG_OMAP_32K_TIMER available=20 on most OMAPs, which seems not to provide a sched_clock() (I suppose we=20 could make DPM timing dependent on CONFIG_OMAP_MPU_TIMER). Since all platforms supported so far by DPM on sourceforge now have=20 microsecond-resolution sched_clock(), we can actually drop dpm_md_time() = entirely and just use sched_clock(). A couple brief comments on your patch: +extern unsigned long long sched_clock(void); This should come from include/linux/sched.h. +#define dpm_md_time() ~sched_clock() I believe the bitwise negation (in order to convert the MPU timer value=20 to an up counter) can be dropped, sched_clock is already doing "0 -=20 omap_mpu_timer_read(0)" for the same purpose. Feel free to send an updated patch or one way or another I'll get to=20 this soon, thanks, --=20 Todd |