Re: Clock Source in hrtimer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/15/10, wilbur.chan <wilbur512@xxxxxxxxx> wrote:
> I am planning to use  linux 2.6.24  with hrtimer enabled and with
> CONFIG_NO_HZ  on mips xlr 732.
>
>
> As we know, a   monotomic increasing Clock Source is required to
> support hrtimer,  whose cycles could be retrieved  from
> clocksource->read function.
>
> However  on  xlr 732 ,there is only a 32 bits counter register, which
> would overflow in 4s ( 2^32 / 1GHZ = 4).
>
> How to solve this ?
>

don't worry about it, the timekeeper solves it:

kernel/time/timekeeping.c

The r4k timer in most of the MIPS variants also only has a 32bits
counter register, no problem with it:

arch/mips/kernel/csrc-r4k.c
arch/mips/kernel/cevt-r4k.c

does  xlr 732 also use such a timer (with MIPS count & compare
registers of coprocessor0)?

If you need to get the time with high resolution, please use:
getnstimeofday(), this function will return a linear time with the
help of timekeeper(timekeeping_get_ns).

Regards,
Wu Zhangjin



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux