mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
ntp: correct inconsistent interval/tick_length usage
clocksource initialization and error accumulation. This corrects a 280ppm drift seen on some systems using acpi_pm, and affects other clocksources as well (likely to a lesser degree). Signed-off-by: John Stultz <johnstul@us.ibm.com> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
25f6663006
commit
e13a2e61dd
2 changed files with 8 additions and 5 deletions
|
@ -232,7 +232,14 @@ static inline int ntp_synced(void)
|
|||
#else
|
||||
#define NTP_INTERVAL_FREQ (HZ)
|
||||
#endif
|
||||
#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ)
|
||||
|
||||
#define CLOCK_TICK_OVERFLOW (LATCH * HZ - CLOCK_TICK_RATE)
|
||||
#define CLOCK_TICK_ADJUST (((s64)CLOCK_TICK_OVERFLOW * NSEC_PER_SEC) / \
|
||||
(s64)CLOCK_TICK_RATE)
|
||||
|
||||
/* Because using NSEC_PER_SEC would be too easy */
|
||||
#define NTP_INTERVAL_LENGTH ((((s64)TICK_USEC * NSEC_PER_USEC * USER_HZ) + \
|
||||
CLOCK_TICK_ADJUST) / NTP_INTERVAL_FREQ)
|
||||
|
||||
/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */
|
||||
extern u64 current_tick_length(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue