diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-01 11:48:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-01 11:48:25 -0500 |
commit | e56425b135a8892d1e71ad5bb605d12c10efeb32 (patch) | |
tree | 9bb899e1b6b45a125bcc21554f3673878d932035 /kernel | |
parent | 786f8ba2e9449a7f01ec6bc35838d0a335921061 (diff) | |
parent | 6622e670b26fbaa9c4ae7772a4d2d0abd3414b51 (diff) |
Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
posix-timers.c: Don't export local functions
clocksource: start CMT at clocksource resume
clocksource: add suspend callback
clocksource: add argument to resume callback
ntp: Cleanup xtime references in ntp.c
ntp: Make time_esterror and time_maxerror static
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/posix-timers.c | 2 | ||||
-rw-r--r-- | kernel/time/clocksource.c | 14 | ||||
-rw-r--r-- | kernel/time/ntp.c | 10 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 1 |
4 files changed, 20 insertions, 7 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 495440779ce3..00d1fda58ab6 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -256,7 +256,7 @@ static int posix_get_monotonic_coarse(clockid_t which_clock, | |||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | 258 | ||
259 | int posix_get_coarse_res(const clockid_t which_clock, struct timespec *tp) | 259 | static int posix_get_coarse_res(const clockid_t which_clock, struct timespec *tp) |
260 | { | 260 | { |
261 | *tp = ktime_to_timespec(KTIME_LOW_RES); | 261 | *tp = ktime_to_timespec(KTIME_LOW_RES); |
262 | return 0; | 262 | return 0; |
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 13700833c181..1f663d23e85e 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -453,6 +453,18 @@ static inline int clocksource_watchdog_kthread(void *data) { return 0; } | |||
453 | #endif /* CONFIG_CLOCKSOURCE_WATCHDOG */ | 453 | #endif /* CONFIG_CLOCKSOURCE_WATCHDOG */ |
454 | 454 | ||
455 | /** | 455 | /** |
456 | * clocksource_suspend - suspend the clocksource(s) | ||
457 | */ | ||
458 | void clocksource_suspend(void) | ||
459 | { | ||
460 | struct clocksource *cs; | ||
461 | |||
462 | list_for_each_entry_reverse(cs, &clocksource_list, list) | ||
463 | if (cs->suspend) | ||
464 | cs->suspend(cs); | ||
465 | } | ||
466 | |||
467 | /** | ||
456 | * clocksource_resume - resume the clocksource(s) | 468 | * clocksource_resume - resume the clocksource(s) |
457 | */ | 469 | */ |
458 | void clocksource_resume(void) | 470 | void clocksource_resume(void) |
@@ -461,7 +473,7 @@ void clocksource_resume(void) | |||
461 | 473 | ||
462 | list_for_each_entry(cs, &clocksource_list, list) | 474 | list_for_each_entry(cs, &clocksource_list, list) |
463 | if (cs->resume) | 475 | if (cs->resume) |
464 | cs->resume(); | 476 | cs->resume(cs); |
465 | 477 | ||
466 | clocksource_resume_watchdog(); | 478 | clocksource_resume_watchdog(); |
467 | } | 479 | } |
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 4800f933910e..7c0f180d6e9d 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -58,10 +58,10 @@ static s64 time_offset; | |||
58 | static long time_constant = 2; | 58 | static long time_constant = 2; |
59 | 59 | ||
60 | /* maximum error (usecs): */ | 60 | /* maximum error (usecs): */ |
61 | long time_maxerror = NTP_PHASE_LIMIT; | 61 | static long time_maxerror = NTP_PHASE_LIMIT; |
62 | 62 | ||
63 | /* estimated error (usecs): */ | 63 | /* estimated error (usecs): */ |
64 | long time_esterror = NTP_PHASE_LIMIT; | 64 | static long time_esterror = NTP_PHASE_LIMIT; |
65 | 65 | ||
66 | /* frequency offset (scaled nsecs/secs): */ | 66 | /* frequency offset (scaled nsecs/secs): */ |
67 | static s64 time_freq; | 67 | static s64 time_freq; |
@@ -142,11 +142,11 @@ static void ntp_update_offset(long offset) | |||
142 | * Select how the frequency is to be controlled | 142 | * Select how the frequency is to be controlled |
143 | * and in which mode (PLL or FLL). | 143 | * and in which mode (PLL or FLL). |
144 | */ | 144 | */ |
145 | secs = xtime.tv_sec - time_reftime; | 145 | secs = get_seconds() - time_reftime; |
146 | if (unlikely(time_status & STA_FREQHOLD)) | 146 | if (unlikely(time_status & STA_FREQHOLD)) |
147 | secs = 0; | 147 | secs = 0; |
148 | 148 | ||
149 | time_reftime = xtime.tv_sec; | 149 | time_reftime = get_seconds(); |
150 | 150 | ||
151 | offset64 = offset; | 151 | offset64 = offset; |
152 | freq_adj = (offset64 * secs) << | 152 | freq_adj = (offset64 * secs) << |
@@ -368,7 +368,7 @@ static inline void process_adj_status(struct timex *txc, struct timespec *ts) | |||
368 | * reference time to current time. | 368 | * reference time to current time. |
369 | */ | 369 | */ |
370 | if (!(time_status & STA_PLL) && (txc->status & STA_PLL)) | 370 | if (!(time_status & STA_PLL) && (txc->status & STA_PLL)) |
371 | time_reftime = xtime.tv_sec; | 371 | time_reftime = get_seconds(); |
372 | 372 | ||
373 | /* only set allowed bits */ | 373 | /* only set allowed bits */ |
374 | time_status &= STA_RONLY; | 374 | time_status &= STA_RONLY; |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index e2ab064c6d41..16736379a9ca 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -622,6 +622,7 @@ static int timekeeping_suspend(struct sys_device *dev, pm_message_t state) | |||
622 | write_sequnlock_irqrestore(&xtime_lock, flags); | 622 | write_sequnlock_irqrestore(&xtime_lock, flags); |
623 | 623 | ||
624 | clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL); | 624 | clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL); |
625 | clocksource_suspend(); | ||
625 | 626 | ||
626 | return 0; | 627 | return 0; |
627 | } | 628 | } |