[Top] [All Lists]

Re: Clock Source in hrtimer

To: "wilbur.chan" <>
Subject: Re: Clock Source in hrtimer
From: wu zhangjin <>
Date: Sun, 15 Aug 2010 14:14:17 +0800
Cc: Linux MIPS Mailing List <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; 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;; 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: <>
Original-recipient: rfc822;
References: <>
On 8/15/10, wilbur.chan <> 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:


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


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

Wu Zhangjin

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