@@ -125,6 +125,13 @@ static u64 suspend_start;
125125 *
126126 * The default of 500 parts per million is based on NTP's limits.
127127 * If a clocksource is good enough for NTP, it is good enough for us!
128+ *
129+ * In other words, by default, even if a clocksource is extremely
130+ * precise (for example, with a sub-nanosecond period), the maximum
131+ * permissible skew between the clocksource watchdog and the clocksource
132+ * under test is not permitted to go below the 500ppm minimum defined
133+ * by MAX_SKEW_USEC. This 500ppm minimum may be overridden using the
134+ * CLOCKSOURCE_WATCHDOG_MAX_SKEW_US Kconfig option.
128135 */
129136#ifdef CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US
130137#define MAX_SKEW_USEC CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US
@@ -1146,14 +1153,19 @@ void __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq
11461153 }
11471154
11481155 /*
1149- * If the uncertainty margin is not specified, calculate it.
1150- * If both scale and freq are non-zero, calculate the clock
1151- * period, but bound below at 2*WATCHDOG_MAX_SKEW. However,
1152- * if either of scale or freq is zero, be very conservative and
1153- * take the tens-of-milliseconds WATCHDOG_THRESHOLD value for the
1154- * uncertainty margin. Allow stupidly small uncertainty margins
1155- * to be specified by the caller for testing purposes, but warn
1156- * to discourage production use of this capability.
1156+ * If the uncertainty margin is not specified, calculate it. If
1157+ * both scale and freq are non-zero, calculate the clock period, but
1158+ * bound below at 2*WATCHDOG_MAX_SKEW, that is, 500ppm by default.
1159+ * However, if either of scale or freq is zero, be very conservative
1160+ * and take the tens-of-milliseconds WATCHDOG_THRESHOLD value
1161+ * for the uncertainty margin. Allow stupidly small uncertainty
1162+ * margins to be specified by the caller for testing purposes,
1163+ * but warn to discourage production use of this capability.
1164+ *
1165+ * Bottom line: The sum of the uncertainty margins of the
1166+ * watchdog clocksource and the clocksource under test will be at
1167+ * least 500ppm by default. For more information, please see the
1168+ * comment preceding CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US above.
11571169 */
11581170 if (scale && freq && !cs -> uncertainty_margin ) {
11591171 cs -> uncertainty_margin = NSEC_PER_SEC / (scale * freq );
0 commit comments