lkml.org 
[lkml]   [2013]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: timekeeping_adjust may set mult to 0
From
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.

Instead of calculating the clocksource mult/shift pair yourself,
please use clocksource_register_hz/khz().

I'm hoping to kill off the open clocksource_register() call soon, to
avoid this sort of confusion. Sorry for the trouble.

thanks
-john


\
 
 \ /
  Last update: 2013-02-16 00:22    [W:0.046 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site