diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index e85c234..0590983 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -187,6 +187,8 @@ static DEFINE_SPINLOCK(watchdog_lock); static cycle_t watchdog_last; static int watchdog_running; +static int volatile clocksource_resume_watchdog; + static int clocksource_watchdog_kthread(void *data); static void __clocksource_change_rating(struct clocksource *cs, int rating); @@ -253,6 +255,11 @@ static void clocksource_watchdog(unsigned long data) if (!watchdog_running) goto out; + if (unlikely(clocksource_resume_watchdog)) { + clocksource_reset_watchdog(); + clocksource_resume_watchdog = 0; + } + wdnow = watchdog->read(watchdog); wd_nsec = clocksource_cyc2ns((wdnow - watchdog_last) & watchdog->mask, watchdog->mult, watchdog->shift); @@ -341,11 +348,7 @@ static inline void clocksource_reset_watchdog(void) static void clocksource_resume_watchdog(void) { - unsigned long flags; - - spin_lock_irqsave(&watchdog_lock, flags); - clocksource_reset_watchdog(); - spin_unlock_irqrestore(&watchdog_lock, flags); + clocksource_resume_watchdog = 1; } static void clocksource_enqueue_watchdog(struct clocksource *cs)