diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2007-05-09 05:35:15 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 15:30:56 -0400 |
| commit | b52f52a093bb1e841e014c2087b5bee7162da413 (patch) | |
| tree | 7b7135897195fc9d14473d3ab824d59a4b65e5ad /include/linux | |
| parent | 4037d452202e34214e8a939fa5621b2b3bbb45b7 (diff) | |
clocksource: fix resume logic
We need to make sure that the clocksources are resumed, when timekeeping is
resumed. The current resume logic does not guarantee this.
Add a resume function pointer to the clocksource struct, so clocksource
drivers which need to reinitialize the clocksource can provide a resume
function.
Add a resume function, which calls the maybe available clocksource resume
functions and resets the watchdog function, so a stable TSC can be used
accross suspend/resume.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/clocksource.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 2665ca04cf..bf297b03a4 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -49,6 +49,7 @@ struct clocksource; | |||
| 49 | * @shift: cycle to nanosecond divisor (power of two) | 49 | * @shift: cycle to nanosecond divisor (power of two) |
| 50 | * @flags: flags describing special properties | 50 | * @flags: flags describing special properties |
| 51 | * @vread: vsyscall based read | 51 | * @vread: vsyscall based read |
| 52 | * @resume: resume function for the clocksource, if necessary | ||
| 52 | * @cycle_interval: Used internally by timekeeping core, please ignore. | 53 | * @cycle_interval: Used internally by timekeeping core, please ignore. |
| 53 | * @xtime_interval: Used internally by timekeeping core, please ignore. | 54 | * @xtime_interval: Used internally by timekeeping core, please ignore. |
| 54 | */ | 55 | */ |
| @@ -65,6 +66,7 @@ struct clocksource { | |||
| 65 | u32 shift; | 66 | u32 shift; |
| 66 | unsigned long flags; | 67 | unsigned long flags; |
| 67 | cycle_t (*vread)(void); | 68 | cycle_t (*vread)(void); |
| 69 | void (*resume)(void); | ||
| 68 | 70 | ||
| 69 | /* timekeeping specific data, ignore */ | 71 | /* timekeeping specific data, ignore */ |
| 70 | cycle_t cycle_interval; | 72 | cycle_t cycle_interval; |
| @@ -209,6 +211,7 @@ static inline void clocksource_calculate_interval(struct clocksource *c, | |||
| 209 | extern int clocksource_register(struct clocksource*); | 211 | extern int clocksource_register(struct clocksource*); |
| 210 | extern struct clocksource* clocksource_get_next(void); | 212 | extern struct clocksource* clocksource_get_next(void); |
| 211 | extern void clocksource_change_rating(struct clocksource *cs, int rating); | 213 | extern void clocksource_change_rating(struct clocksource *cs, int rating); |
| 214 | extern void clocksource_resume(void); | ||
| 212 | 215 | ||
| 213 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL | 216 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL |
| 214 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); | 217 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); |
