diff options
Diffstat (limited to 'kernel/time/clocksource.c')
-rw-r--r-- | kernel/time/clocksource.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 3db5c3c460d7..51b6a6a6158c 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -74,7 +74,7 @@ static struct clocksource *watchdog; | |||
74 | static struct timer_list watchdog_timer; | 74 | static struct timer_list watchdog_timer; |
75 | static DEFINE_SPINLOCK(watchdog_lock); | 75 | static DEFINE_SPINLOCK(watchdog_lock); |
76 | static cycle_t watchdog_last; | 76 | static cycle_t watchdog_last; |
77 | static int watchdog_resumed; | 77 | static unsigned long watchdog_resumed; |
78 | 78 | ||
79 | /* | 79 | /* |
80 | * Interval: 0.5sec Threshold: 0.0625s | 80 | * Interval: 0.5sec Threshold: 0.0625s |
@@ -104,9 +104,7 @@ static void clocksource_watchdog(unsigned long data) | |||
104 | 104 | ||
105 | spin_lock(&watchdog_lock); | 105 | spin_lock(&watchdog_lock); |
106 | 106 | ||
107 | resumed = watchdog_resumed; | 107 | resumed = test_and_clear_bit(0, &watchdog_resumed); |
108 | if (unlikely(resumed)) | ||
109 | watchdog_resumed = 0; | ||
110 | 108 | ||
111 | wdnow = watchdog->read(); | 109 | wdnow = watchdog->read(); |
112 | wd_nsec = cyc2ns(watchdog, (wdnow - watchdog_last) & watchdog->mask); | 110 | wd_nsec = cyc2ns(watchdog, (wdnow - watchdog_last) & watchdog->mask); |
@@ -151,9 +149,7 @@ static void clocksource_watchdog(unsigned long data) | |||
151 | } | 149 | } |
152 | static void clocksource_resume_watchdog(void) | 150 | static void clocksource_resume_watchdog(void) |
153 | { | 151 | { |
154 | spin_lock(&watchdog_lock); | 152 | set_bit(0, &watchdog_resumed); |
155 | watchdog_resumed = 1; | ||
156 | spin_unlock(&watchdog_lock); | ||
157 | } | 153 | } |
158 | 154 | ||
159 | static void clocksource_check_watchdog(struct clocksource *cs) | 155 | static void clocksource_check_watchdog(struct clocksource *cs) |