diff options
| -rw-r--r-- | kernel/time/timekeeping.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 2988bc819187..e16af197a2bc 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
| @@ -923,20 +923,22 @@ static void timekeeping_adjust(struct timekeeper *tk, s64 offset) | |||
| 923 | if (likely(error <= interval)) | 923 | if (likely(error <= interval)) |
| 924 | adj = 1; | 924 | adj = 1; |
| 925 | else | 925 | else |
| 926 | adj = timekeeping_bigadjust(tk, error, &interval, | 926 | adj = timekeeping_bigadjust(tk, error, &interval, &offset); |
| 927 | &offset); | 927 | } else { |
| 928 | } else if (error < -interval) { | 928 | if (error < -interval) { |
| 929 | /* See comment above, this is just switched for the negative */ | 929 | /* See comment above, this is just switched for the negative */ |
| 930 | error >>= 2; | 930 | error >>= 2; |
| 931 | if (likely(error >= -interval)) { | 931 | if (likely(error >= -interval)) { |
| 932 | adj = -1; | 932 | adj = -1; |
| 933 | interval = -interval; | 933 | interval = -interval; |
| 934 | offset = -offset; | 934 | offset = -offset; |
| 935 | } else | 935 | } else { |
| 936 | adj = timekeeping_bigadjust(tk, error, &interval, | 936 | adj = timekeeping_bigadjust(tk, error, &interval, &offset); |
| 937 | &offset); | 937 | } |
| 938 | } else | 938 | } else { |
| 939 | return; | 939 | goto out_adjust; |
| 940 | } | ||
| 941 | } | ||
| 940 | 942 | ||
| 941 | if (unlikely(tk->clock->maxadj && | 943 | if (unlikely(tk->clock->maxadj && |
| 942 | (tk->mult + adj > tk->clock->mult + tk->clock->maxadj))) { | 944 | (tk->mult + adj > tk->clock->mult + tk->clock->maxadj))) { |
| @@ -999,6 +1001,7 @@ static void timekeeping_adjust(struct timekeeper *tk, s64 offset) | |||
| 999 | tk->xtime_nsec -= offset; | 1001 | tk->xtime_nsec -= offset; |
| 1000 | tk->ntp_error -= (interval - offset) << tk->ntp_error_shift; | 1002 | tk->ntp_error -= (interval - offset) << tk->ntp_error_shift; |
| 1001 | 1003 | ||
| 1004 | out_adjust: | ||
| 1002 | /* | 1005 | /* |
| 1003 | * It may be possible that when we entered this function, xtime_nsec | 1006 | * It may be possible that when we entered this function, xtime_nsec |
| 1004 | * was very small. Further, if we're slightly speeding the clocksource | 1007 | * was very small. Further, if we're slightly speeding the clocksource |
