Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
ntp: Clamp PLL update interval

+11 -3
+11 -3
kernel/time/ntp.c
··· 149 149 time_reftime = get_seconds(); 150 150 151 151 offset64 = offset; 152 - freq_adj = (offset64 * secs) << 153 - (NTP_SCALE_SHIFT - 2 * (SHIFT_PLL + 2 + time_constant)); 152 + freq_adj = ntp_update_offset_fll(offset64, secs); 154 153 155 - freq_adj += ntp_update_offset_fll(offset64, secs); 154 + /* 155 + * Clamp update interval to reduce PLL gain with low 156 + * sampling rate (e.g. intermittent network connection) 157 + * to avoid instability. 158 + */ 159 + if (unlikely(secs > 1 << (SHIFT_PLL + 1 + time_constant))) 160 + secs = 1 << (SHIFT_PLL + 1 + time_constant); 161 + 162 + freq_adj += (offset64 * secs) << 163 + (NTP_SCALE_SHIFT - 2 * (SHIFT_PLL + 2 + time_constant)); 156 164 157 165 freq_adj = min(freq_adj + time_freq, MAXFREQ_SCALED); 158 166