diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-31 15:09:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-31 15:09:57 -0400 |
commit | 6eb80e00bff341dd09a7ec8b9dba6da8410448bf (patch) | |
tree | c0966b7f7d2bb3510de15226a61071abb3d8c453 | |
parent | d27d4e2a660939f1bdf74f0e24c4c109f90cd98d (diff) | |
parent | c7121843685de2bf7f3afd3ae1d6a146010bf1fc (diff) |
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
clocksource: Save mult_orig in clocksource_disable()
-rw-r--r-- | include/linux/clocksource.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index c56457c8334e..1219be4fb42e 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -293,7 +293,12 @@ static inline int clocksource_enable(struct clocksource *cs) | |||
293 | if (cs->enable) | 293 | if (cs->enable) |
294 | ret = cs->enable(cs); | 294 | ret = cs->enable(cs); |
295 | 295 | ||
296 | /* save mult_orig on enable */ | 296 | /* |
297 | * The frequency may have changed while the clocksource | ||
298 | * was disabled. If so the code in ->enable() must update | ||
299 | * the mult value to reflect the new frequency. Make sure | ||
300 | * mult_orig follows this change. | ||
301 | */ | ||
297 | cs->mult_orig = cs->mult; | 302 | cs->mult_orig = cs->mult; |
298 | 303 | ||
299 | return ret; | 304 | return ret; |
@@ -309,6 +314,13 @@ static inline int clocksource_enable(struct clocksource *cs) | |||
309 | */ | 314 | */ |
310 | static inline void clocksource_disable(struct clocksource *cs) | 315 | static inline void clocksource_disable(struct clocksource *cs) |
311 | { | 316 | { |
317 | /* | ||
318 | * Save mult_orig in mult so clocksource_enable() can | ||
319 | * restore the value regardless if ->enable() updates | ||
320 | * the value of mult or not. | ||
321 | */ | ||
322 | cs->mult = cs->mult_orig; | ||
323 | |||
312 | if (cs->disable) | 324 | if (cs->disable) |
313 | cs->disable(cs); | 325 | cs->disable(cs); |
314 | } | 326 | } |