aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/clocksource.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index a1657b5fdeb9..02dc22d888fe 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -307,16 +307,23 @@ static void clocksource_watchdog_work(struct work_struct *work)
307{ 307{
308 struct clocksource *cs, *tmp; 308 struct clocksource *cs, *tmp;
309 unsigned long flags; 309 unsigned long flags;
310 LIST_HEAD(unstable);
310 311
311 spin_lock_irqsave(&watchdog_lock, flags); 312 spin_lock_irqsave(&watchdog_lock, flags);
312 list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list) 313 list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list)
313 if (cs->flags & CLOCK_SOURCE_UNSTABLE) { 314 if (cs->flags & CLOCK_SOURCE_UNSTABLE) {
314 list_del_init(&cs->wd_list); 315 list_del_init(&cs->wd_list);
315 clocksource_change_rating(cs, 0); 316 list_add(&cs->wd_list, &unstable);
316 } 317 }
317 /* Check if the watchdog timer needs to be stopped. */ 318 /* Check if the watchdog timer needs to be stopped. */
318 clocksource_stop_watchdog(); 319 clocksource_stop_watchdog();
319 spin_unlock(&watchdog_lock); 320 spin_unlock_irqrestore(&watchdog_lock, flags);
321
322 /* Needs to be done outside of watchdog lock */
323 list_for_each_entry_safe(cs, tmp, &unstable, wd_list) {
324 list_del_init(&cs->wd_list);
325 clocksource_change_rating(cs, 0);
326 }
320} 327}
321 328
322#else /* CONFIG_CLOCKSOURCE_WATCHDOG */ 329#else /* CONFIG_CLOCKSOURCE_WATCHDOG */