linux-mips
[Top] [All Lists]

Re: Clock Source in hrtimer

To: "wilbur.chan" <wilbur512@gmail.com>
Subject: Re: Clock Source in hrtimer
From: wu zhangjin <wuzhangjin@gmail.com>
Date: Sun, 15 Aug 2010 14:14:17 +0800
Cc: Linux MIPS Mailing List <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=nftAXQebPIsTErUrYNnz3pLj4zAAyJcRLyk9dzXvtzw=; b=pw5tRifUvRMcW0qWx82rLUG/05X7A0LsWPTSA8RxLZ2nyvkrT0ZwgphXGAbnopERab Ge0nennFHQNXBPkszbKdNzMVD8Bb7FVO7hkiV3Tf9gIzq21is/jfOiQ9pjOPSjOgTEPF ujQqvTb5Y6T2QrG0Ppoo6BbeJFeBN1Pjkaf/Q=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=t6N3CWiMS9QySea3O1O14fFDVs6Kc+WRsq1z2mYVO6ug0t00ds28cmB6+uOpNo8BYh uaH9EXd91IyTJ2cy5nmXIAkkcs4IQYSQgK+eiTX3TUekv+jwSUYsre86jYU3ZWBjby7B zsji1z389qgVvj7i0BCytIeOwKHWJAQC/PaKk=
In-reply-to: <AANLkTik5o+LsApwvkDTb7z+k=Ls60h9PJugrvM7ozO=p@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <AANLkTik5o+LsApwvkDTb7z+k=Ls60h9PJugrvM7ozO=p@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
On 8/15/10, wilbur.chan <wilbur512@gmail.com> 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

<Prev in Thread] Current Thread [Next in Thread>