From: john stultz Call ntp_synced() is frequently enough. This fixes a potential bug where when ntp_synced is called, it isn't close enough to the second boundery (which is tested inside ntp_synced()). Without this its possible that since we only called it once a second, it would never sync the persistent clock. Signed-off-by: John Stultz Signed-off-by: Andrew Morton --- kernel/time/timeofday.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff -puN kernel/time/timeofday.c~time-generic-timekeeping-infrastructure-fix-ntp_synced kernel/time/timeofday.c --- devel/kernel/time/timeofday.c~time-generic-timekeeping-infrastructure-fix-ntp_synced 2006-02-21 13:35:00.000000000 -0800 +++ devel-akpm/kernel/time/timeofday.c 2006-02-21 13:35:00.000000000 -0800 @@ -534,7 +534,7 @@ static void timeofday_periodic_hook(unsi /* advance the ntp state machine by ns interval: */ ntp_advance(delta_nsec); - /* only call ntp_leapsecond and ntp_sync once a sec: */ + /* only call ntp_leapsecond once a sec: */ second_check += delta_nsec; if (second_check >= NSEC_PER_SEC) { /* do ntp leap second processing: */ @@ -545,11 +545,11 @@ static void timeofday_periodic_hook(unsi wall_time_ts.tv_sec += leapsecond; monotonic_time_offset_ts.tv_sec += leapsecond; } - /* sync the persistent clock: */ - if (ntp_synced()) - sync_persistent_clock(wall_time_ts); second_check -= NSEC_PER_SEC; } + /* sync the persistent clock: */ + if (ntp_synced()) + sync_persistent_clock(wall_time_ts); /* if necessary, switch clocksources: */ next = get_next_clocksource(); _