aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Walker <kwalker@redhat.com>2016-08-06 12:07:30 -0400
committerJohn Stultz <john.stultz@linaro.org>2016-08-31 17:43:33 -0400
commit36374583f9084cdab4b5dcf5521a3ce55bebb9fa (patch)
tree9db17d8912137a810530add26d78f7d67e8462cf
parentb4d90e9f1ef1f19dcb2b1b1942c786c9c4225460 (diff)
clocksource: Defer override invalidation unless clock is unstable
Clocksources don't get the VALID_FOR_HRES flag until they have been checked by a watchdog. However, when using an override, the clocksource_select logic will clear the override value if the clocksource is not marked VALID_FOR_HRES during that inititial check. When using the boot arguments clocksource=<foo>, this selection can run before the watchdog, and can cause the override to be incorrectly cleared. To address this condition, the override_name is only invalidated for unstable clocksources. Otherwise, the override is left intact until after the watchdog has validated the clocksource as stable/unstable. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Kyle Walker <kwalker@redhat.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--kernel/time/clocksource.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 6a5a310a1a53..7e4fad75acaa 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -600,9 +600,18 @@ static void __clocksource_select(bool skipcur)
600 */ 600 */
601 if (!(cs->flags & CLOCK_SOURCE_VALID_FOR_HRES) && oneshot) { 601 if (!(cs->flags & CLOCK_SOURCE_VALID_FOR_HRES) && oneshot) {
602 /* Override clocksource cannot be used. */ 602 /* Override clocksource cannot be used. */
603 pr_warn("Override clocksource %s is not HRT compatible - cannot switch while in HRT/NOHZ mode\n", 603 if (cs->flags & CLOCK_SOURCE_UNSTABLE) {
604 cs->name); 604 pr_warn("Override clocksource %s is unstable and not HRT compatible - cannot switch while in HRT/NOHZ mode\n",
605 override_name[0] = 0; 605 cs->name);
606 override_name[0] = 0;
607 } else {
608 /*
609 * The override cannot be currently verified.
610 * Deferring to let the watchdog check.
611 */
612 pr_info("Override clocksource %s is not currently HRT compatible - deferring\n",
613 cs->name);
614 }
606 } else 615 } else
607 /* Override clocksource can be used. */ 616 /* Override clocksource can be used. */
608 best = cs; 617 best = cs;