From: David Engraf <david.engraf@sysgo.com>
To: John Stultz <john.stultz@linaro.org>
Cc: John Stultz <johnstul@us.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: timekeeping_adjust may set mult to 0
Date: Tue, 26 Feb 2013 14:05:05 +0100 [thread overview]
Message-ID: <512CB301.8020208@sysgo.com> (raw)
In-Reply-To: <CANcMJZAuKo9yQkErDZYtBx-Bm92hMAG3SDK-DJRPn=m=T9hcag@mail.gmail.com>
Am 15.02.2013 23:34, schrieb John Stultz:
> On Mon, Feb 11, 2013 at 7:48 AM, David Engraf <david.engraf@sysgo.com> wrote:
>> I have encountered a problem when a linux system uses a clocksource with
>> mult = 1 and shift = 0 (clocksource cycle = nanoseconds). It may happen that
>> the function timekeeping_adjust reduces the value of mult to 0 when error is
>> lower than the interval [1].
>> As soon as timekeeper.mult is 0, ktime_get will no longer work because it
>> uses timekeeping_get_ns which converts the cycle to nanoseconds with mult as
>> 0 and the system clocksource returns always 0.
>
> So you *don't* want to use shift=0, since that kills the ability for
> the frequency adjustment code to do anything, as you've found.
The problem is not shift=0 it's mult=1. The frequency adjustment code
may increase/decrease mult and mult=0 will not work.
> Instead of calculating the clocksource mult/shift pair yourself,
> please use clocksource_register_hz/khz().
Thanks, I will try it.
Best regards
- David
> I'm hoping to kill off the open clocksource_register() call soon, to
> avoid this sort of confusion. Sorry for the trouble.
>
> thanks
> -john
>
prev parent reply other threads:[~2013-02-26 13:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-11 15:48 timekeeping_adjust may set mult to 0 David Engraf
2013-02-15 22:34 ` John Stultz
2013-02-26 13:05 ` David Engraf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=512CB301.8020208@sysgo.com \
--to=david.engraf@sysgo.com \
--cc=john.stultz@linaro.org \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.